-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CreateCoreWebView2ControllerAsync can't get a await return #3617
Comments
Thanks for reporting the issue and I've assigned a dev who can help follow up on this. We will also take your suggestion on UI-less sample into consideration. |
Hi, @1CDE683405CAC00EAD7242DCD02BC0AB! Thanks for your feedback. I'm sorry for the delay in answering. I took two weeks off due to a lumbar surgery The WV2's API need to run in a UI thread. And could you help to test that set the thread into a UI thread to seed if it can work well?
|
Sorry for replying so late. In actually ,I have solved the problem from issue #202 at the day it was asked. |
I want to use WebView2 in .Net6 classlib without UI framework. And I write some code in method like below
then I debug the code and meet a problem that CreateCoreWebView2ControllerAsync can't get a await return.
I found the same issue#202.
According to that answer, I need to add a dispatcher, but the class of Dispatcher is located in "WindowsBase.dll", because my classlib's targetframe is ".Net6", not ".Net6-windows", so I can't reference the dll into my classlib.
After asked google, I found that If I really want to reference the "WindowsBase.dll", I have to change my classlib targetframe to ".Net6-windows" and enable "UseWPF". but in this case ,I will lose the ability of cross-platform and It's also not really a UIframework-less.
I found the roadmap of webview2 said there will have the MacOS/Linux Preview. I'm very confused If that is true, how can I get a dispatcher in Linux platform in the future?
But that's not the most important, at the moment, I wonder if there is another way to introduce a dispatcher to my classlib or another way to pass through the CreateCoreWebView2ControllerAsync. If the solution can retain the ability of cross-platform, that is the best.
By the way, I can't seem to find a UIframework-less sample in the Webview2 samples repository, maybe it should add one.
The text was updated successfully, but these errors were encountered: