Replies: 4 comments
-
I had exact same issue in our Outlook VSTO Add-in, but it was cause by creatung webView2 environment on the background thread. When I switched it to the main thread, it started working as expected. |
Beta Was this translation helpful? Give feedback.
-
@GHext , is the above comment helpful? If not, could you share the details of the InitializationException of CoreWebView2InitializationCompletedEventArgs reported by CoreWebView2InitializationCompleted event? |
Beta Was this translation helpful? Give feedback.
-
What exception are you seeing? As WebView2 creation timeout takes more than 2 minutes, if we wait for 3 minutes, would there be any exceptions thrown? Do you see message printed out if you run the app under debugger? Another common issue if that we are not setting user data folder for WebView2 and the default user data folder is not writable by current user. You might want to try change await webView2.EnsureCoreWebView2Async(); to the following and see whether that makes any difference. var env = await CoreWebView2Environment.CreateAsync(null, "C:\temp"); |
Beta Was this translation helpful? Give feedback.
-
Could you add WebView to UI ( Also it should be Another basic thing to ensure is that you do have Microsoft Edge WebView2 Runtime installed on the machine., |
Beta Was this translation helpful? Give feedback.
-
(1) webView2.EnsureCoreWebView2Async();
does not return anything and CoreWebView2 is already null.
(3) webView21.CoreWebView2InitializationCompleted() event
the control's Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2 InitializationCompletedevent will be invoked before the task completes or on exceptions.
await, WebView2 should return something.
Beta Was this translation helpful? Give feedback.
All reactions