MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: HRESULT: 0x8007139F, unable to use WebView2 anymore on entire machine.

Open
#5,612 0 comments 0 reactions 1 assignee View on GitHub

@prija-microsoft is already working on this.

Since Jun 24, 2026.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

What happened?

While running some local tests using involving opening and closing multiple WebView2 components one after another, one of our users suddenly started getting the error "The group or resource is not in the correct state to perform the requested operation. (Exception from HRESULT: 0x8007139F)", with the following stack trace:

at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.d__15.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Web.WebView2.WinForms.WebView2.d__25.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()

Now, anytime they run any of our applications and attempt to open a WebView2 control, they get the same error - including both deployed and local versions of the applications. Looking through some of the issues on this page, we tried a few things to fix this, but none of them worked. This includes:

  • Restarting the computer to shut off any interfering processes

  • Checking for any Edge-related Parameters under the following registry keys (none were present)

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
  • Repairing and reinstalling the WebView2 runtime

  • Deleting the application User Data folder, and even setting a custom User Data folder in one of our applications' WebView2 environment to see if we could start from a blank slate

Ultimately, none of this worked. Are there any other workarounds that might fix the immediate issue?

Also, aside from ensuring that each application has a single shared WebView2 environment (which we did not do prior to this and may have caused this issue in the first place), are there any other best practices to avoid having this issue happen again? It would be very problematic if it happened to one of our clients.

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

No response

SDK Version

No response

Framework

Winforms

Operating System

Windows 11

OS Version

No response

Repro steps

Attempt to create and close multiple WebView2 components, each with their own CoreWebView2Environment that is generated using default values. It is expected to successfully create each one, but there appears to be a chance after the second one for any new WebView2 components to throw an exception when attempting to call EnsureCoreWebView2Async.

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.