WebView2 stops working after 2 - 3 days with HRESULT 0x8007139F in WinForms application

test code 21 Reputation points
2026-08-26T12:10:17.6733333+00:00

We have a VB.NET WinForms application that uses five WebView2 controls on the same form.

A client is experiencing the following problem:

  • WebView2 works normally for approximately 2–3 days.
  • After that, the application only shows the loading state and the WebView does not start.
  • Replacing the WebView2 runtime makes the application work again temporarily.
  • After another 2–3 days, the same problem returns.
  • This happens with both the old and new runtime versions.

Runtime versions tested:

Old runtime: 123.0.2420.53_x64

New runtime: 147.0.3912.98_x64

Error:

The group or resource is not in the correct state to perform the requested operation.

(Exception from HRESULT: 0x8007139F)

The application targets .NET Framework and runs as an x86 process. It uses a fixed-version WebView2 runtime and a custom user-data folder under the current user’s local application data:

%LOCALAPPDATA%\runtime_browser 2.0

The application creates a WebView2 environment and uses it to initialize five controls:

Dim environmentOptions As New CoreWebView2EnvironmentOptions()

environmentOptions.AdditionalBrowserArguments = "--disable-web-security"

Dim webViewEnvironment =

    Await CoreWebView2Environment.CreateAsync(

        fixedVersionFolderPath,

        userDataFolder,

        environmentOptions)

Await WebView1.EnsureCoreWebView2Async(webViewEnvironment)

Await WebView2.EnsureCoreWebView2Async(webViewEnvironment)

Await WebView3.EnsureCoreWebView2Async(webViewEnvironment)

Await WebView4.EnsureCoreWebView2Async(webViewEnvironment)

Await WebView5.EnsureCoreWebView2Async(webViewEnvironment)

The form is reused across multiple dialog runs. WebView2 initialization is started from an Async Sub method, and the application may create a new environment on subsequent form loads while the same user-data folder is reused. Form closing does not currently wait for pending initialization to finish before the form lifecycle ends.

Environment creation succeeds, but WebView2 initialization eventually fails while creating the controller. The failure occurs before navigation or website code executes. Replacing the runtime does not provide a permanent solution; it only allows WebView2 to work for another few days.

Questions

  1. What are the most likely causes of 0x8007139F when EnsureCoreWebView2Async fails during controller creation after the application has been running for several days?
  2. What is the recommended solution to fix this problem and prevent the error from recurring?
Developer technologies | .NET | Other

1 answer

Sort by: Most helpful
  1. Danny Nguyen (WICLOUD CORPORATION) 8,540 Reputation points Microsoft External Staff Moderator
    2026-08-27T03:47:49.89+00:00

    Hi @test code ,

    The issue is most likely caused by sharing the same user data folder across multiple CoreWebView2Environment creation calls simultaneously, especially when form closing does not wait for pending initialization to finish.

    The EnsureCoreWebView2Async method can fail if another WebView2 instance is already trying to initialize with the exact same user data folder parameters. When testing with multiple WebView2 instances, you can wait for the first WebView2 instance to finish initialization so it establishes the environment with the user-data folder. Then the rest of the WebView2 controls can just reuse the shared environment.

    Additionally, to prevent the issue from recurring when opening the dialog a second time: ensure the form/dialog gracefully closes and disposes of the WebView2 controls.

    Alternative / Workaround: If the application creates a new environment on subsequent form loads while the same user-data folder is reused:

    1. Try keeping a single globally shared CoreWebView2Environment instance in the application, and use it across all dialogs for EnsureCoreWebView2Async.
    2. Wait for the first WebView2 control on the form to finish initializing, and then initialize the other ones:
    Dim environmentOptions As New CoreWebView2EnvironmentOptions()
    environmentOptions.AdditionalBrowserArguments = "--disable-web-security"
    
    Dim webViewEnvironment = Await CoreWebView2Environment.CreateAsync(
        fixedVersionFolderPath,
        userDataFolder,
        environmentOptions)
    
    ' Initialize the first one and wait for it
    Await WebView1.EnsureCoreWebView2Async(webViewEnvironment)
    
    ' The environment is now fully established, you can initialize the rest
    Await WebView2.EnsureCoreWebView2Async(webViewEnvironment)
    Await WebView3.EnsureCoreWebView2Async(webViewEnvironment)
    Await WebView4.EnsureCoreWebView2Async(webViewEnvironment)
    Await WebView5.EnsureCoreWebView2Async(webViewEnvironment)
    

    If you found my response helpful or informative, I would greatly appreciate it if you could follow this guidance or provide feedback.

    Thank you.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.