WebView2Feedback icon indicating copy to clipboard operation
WebView2Feedback copied to clipboard

[Problem/Bug]: CoInitialize has not been called when creating Edge Webview2 environment

Open RSN1907 opened this issue 1 year ago • 9 comments

What happened?

Our WPF app uses Edge Webview , however in few machines and intermittently when creating EdgeWebview environment we see below exception One or more errors occurred. (CoInitialize has not been called. (0x800401F0 (CO_E_NOTINITIALIZED))) InnerException CoInitialize has not been called. (0x800401F0 (CO_E_NOTINITIALIZED))

at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode) at Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(String browserExecutableFolder, String userDataFolder, CoreWebView2EnvironmentOptions options)

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

125.0.2535.85

SDK Version

1.0.2151.40

Framework

WPF

Operating System

Windows 10

OS Version

21H2

Repro steps

https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2environment.createasync?view=webview2-dotnet-1.0.2535.41 Use the above function to create WebView2 environment within the app

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

RSN1907 avatar Jun 06 '24 04:06 RSN1907

@victorhuangwq Have created this new issue as requested, can you kindly check and also suggest how to upload etl trace as its more than 50 MB

RSN1907 avatar Jun 06 '24 04:06 RSN1907

@lflores-ms Can you kindly suggest how to share traces? Will mail work?

RSN1907 avatar Jun 10 '24 14:06 RSN1907

@victorhuangwq @lflores-ms Can you kindly suggest how to share traces?

RSN1907 avatar Jun 17 '24 16:06 RSN1907

@RSN1907 please upload them wherever you prefer and share at <>

Also, does your app deal with COM? If there are calls to CoUninitialize, that might interefere with WebView creation. Have you been able to reproduce this issue or do you have a sample project where it's demonstrated?

lflores-ms avatar Jun 17 '24 17:06 lflores-ms

@lflores-ms I have shared the traces in gmail and drive, there is no direct interaction with COM ,I have not been able to reproduce the issue and its very intermittent

RSN1907 avatar Jun 17 '24 18:06 RSN1907

@lflores-ms any other additional logs required? Also when app was using Microsoft.Web.WebView2 SDK "1.0.1661.34" issue was not seen but when it was upgraded to 1.0.2151.40 issue is seen consistently in few machines

RSN1907 avatar Jun 21 '24 18:06 RSN1907

@lflores-ms @victorhuangwq We have now more users of our app reporting this issue ,can you kindly help in checking uploaded logs

RSN1907 avatar Jun 27 '24 13:06 RSN1907

@lflores-ms @victorhuangwq Were you able to look at the traces sent over mail?

RSN1907 avatar Jul 03 '24 15:07 RSN1907

@victorhuangwq @lflores-ms Were you able to check the traces

RSN1907 avatar Aug 02 '24 15:08 RSN1907