Skip to content
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

[Problem/Bug]: Webview fails to initialize when uiaccess="true" as of Windows 10 update KB5044273 #4880

Open
CanBanDan opened this issue Oct 24, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@CanBanDan
Copy link

CanBanDan commented Oct 24, 2024

What happened?

As of our Windows 10 security patch KB5044273 the WebView2 browser integration in our application fails to initialization. This only affects Windows 10 devices and is a direct result of having UIAccess enabled and having the application run in program files.

We see a variety of similar exceptions but all involve a failure of EnsureCoreWebView2Async
ERROR [2024-10-23 16:21:41.849] System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (The requested resource is in use. (0x800700AA)) ---> System.Runtime.InteropServices.COMException (0x800700AA): The requested resource is in use. (0x800700AA) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode) at Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateCoreWebView2ControllerAsync(IntPtr ParentWindow) at Microsoft.Web.WebView2.Wpf.WebView2.<>c__DisplayClass33_0.<<EnsureCoreWebView2Async>g__Init|0>d.MoveNext() --- End of stack trace from previous location --- at SensorySoftware.Grids.Grid3.Modules.PlugIns.OfflineWebBrowser.OfflineWebBrowserControl.InitializeBrowserAsync() --- End of inner exception stack trace ---

We understand that this problem was caused upstream but due to the severity of the issue for our application we wanted to reach out and ask if anything can be done within WebView2. We also wished to inform others of the problem.

We currently have three options, none of which are desirable

  • Uninstall the security patch
  • Ask our users to upgrade to Win 11
  • Remove UIAccess

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Stable release (WebView2 Runtime), Prerelease (Edge Canary/Dev/Beta)

Runtime Version

130.0.2849.52

SDK Version

1.0.2210.55, 1.0.2895-prerelease

Framework

WPF

Operating System

Windows 10

OS Version

10.0.19045

Repro steps

You can skip steps 1 & 2 by cloning my fork of the samples repo and checking out the ui-access-breaks-init branch

Must be on Windows 10 and have KB5044273 installed

  1. Clone the WPF samples repo
  2. Add an application manifest that enables UI access.
  3. Build in Release Stable APIs configuration
  4. Code sign the resulting exe (I choose the .NET 6 build but any will do)
  5. Try to run the application. It will start just fine.
  6. Copy the application files into program files.
  7. Try to run. Webview2 will fail to initialize

Here is the stack trace seen for the sample app which is essentially the same as for our application
`---------------------------


WebView2 creation failed with exception = System.Runtime.InteropServices.COMException (0x800700AA): The requested resource is in use. (0x800700AA)

at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)

at Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateCoreWebView2ControllerAsync(IntPtr ParentWindow)

at Microsoft.Web.WebView2.Wpf.WebView2.Microsoft.Web.WebView2.Wpf.IWebView2Private.InitializeController(IntPtr parent_window, CoreWebView2ControllerOptions controllerOptions)

at Microsoft.Web.WebView2.Wpf.WebView2Base.<>c__DisplayClass32_0.<g__Init|0>d.MoveNext()

OK

`

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

@CanBanDan CanBanDan added the bug Something isn't working label Oct 24, 2024
@ehardebeck
Copy link

Looks like I duplicated this issue, with a few more details #4884

@aluhrs13
Copy link
Contributor

This seems to be a regression with Windows 10 KB5044273 and we're following up with Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants