Summary
WebView2 fails to initialize in the WinUI 3 tray app with error:
\
The specified module could not be found. (0x8007007E)
\\
This occurs when calling \EnsureCoreWebView2Async()\ on the WinUI WebView2 control.
Environment
- OS: Windows 11 ARM64
- Windows App SDK: 1.8.250906003
- WebView2 Runtime: 144.0.3719.93 (installed)
- Edge: Present at C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
- App Type: Unpackaged WinUI 3 (WindowsPackageType=None)
- .NET: 9.0
Stack Trace
\
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at WinRT.ActivationFactory.Get(String typeName, Guid iid)
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.get__objRef_global__Microsoft_Web_WebView2_Core_ICoreWebView2EnvironmentStatics()
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateWithOptionsAsync(...)
at OpenClawTray.Windows.WebChatWindow.InitializeWebViewAsync()
\\
What we tried
-
Copying WebView2Loader.dll to output root - The ARM64 loader exists in
untimes/win-arm64/native/\ but wasn't being found. Copying to output root didn't help.
-
Using CreateWithOptionsAsync - Same error
-
Using simple EnsureCoreWebView2Async() - Same error
-
Setting WEBVIEW2_USER_DATA_FOLDER environment variable - No effect
Key observations
- The WinForms version of the same app uses \Microsoft.Web.WebView2\ NuGet package directly and works fine
- The WinUI version relies on WebView2 bundled with Windows App SDK
- Error is in \WinRT.ActivationFactory.Get\ - suggesting COM activation issue
- The WebView2 runtime IS installed (verified via registry and Edge presence)
Possible causes
- ARM64 unpackaged WinUI apps may have issues finding WebView2 COM activation
- Windows App SDK WebView2 integration may differ from standalone package
- Missing app manifest entries for WebView2?
Workaround
Currently falling back to opening chat in browser when WebView2 fails.
Related
- WinForms WebChatForm.cs works with \Microsoft.Web.WebView2\ 1.0.3124.44
- This used to work (allegedly) - need to investigate when it broke
Summary
WebView2 fails to initialize in the WinUI 3 tray app with error:
\
The specified module could not be found. (0x8007007E)
\\
This occurs when calling \EnsureCoreWebView2Async()\ on the WinUI WebView2 control.
Environment
Stack Trace
\
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at WinRT.ActivationFactory.Get(String typeName, Guid iid)
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.get__objRef_global__Microsoft_Web_WebView2_Core_ICoreWebView2EnvironmentStatics()
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateWithOptionsAsync(...)
at OpenClawTray.Windows.WebChatWindow.InitializeWebViewAsync()
\\
What we tried
Copying WebView2Loader.dll to output root - The ARM64 loader exists in
untimes/win-arm64/native/\ but wasn't being found. Copying to output root didn't help.
Using CreateWithOptionsAsync - Same error
Using simple EnsureCoreWebView2Async() - Same error
Setting WEBVIEW2_USER_DATA_FOLDER environment variable - No effect
Key observations
Possible causes
Workaround
Currently falling back to opening chat in browser when WebView2 fails.
Related