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]: Winform app crashes when window.open or Launch two apps and close one #4684

Open
krleegw opened this issue Jul 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@krleegw
Copy link

krleegw commented Jul 16, 2024

What happened?

//Because it goes through a translator, it may not be conveyed well.

I'm creating a Winform app.
If a small number of users do window.open or open two apps and close one of them, the remaining webview2 also dies.
Most users will find it works without problems.

I think an error occurs while releasing resources in the above two methods, and all processes are terminated.
Something is being shared between processes, but I have no clue.

Here are the methods I tried:

  1. Change permissions of userdatafolder / delete userdatafolder and run apps
    Changing it doesn't help, and there are no files in the Crashpad folder.

  2. Change in initialization method
    string UserDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
    CoreWebView2EnvironmentOptions options = new CoreWebView2EnvironmentOptions();
    CoreWebView2Environment env = CoreWebView2Environment.CreateAsync("", UserDataFolder, options).GetAwaiter().GetResult();
    LoadWebView2(env);

    private async void LoadWebView2(CoreWebView2Environment env)
    {
    await webView21.EnsureCoreWebView2Async(env);

         webView21.CoreWebView2.ProcessFailed += WebView2_ProcessFailed;
    
         
         webView21.CoreWebView2.Navigate(strURL);
     }
    

    ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    private async void LoadWebView2(CoreWebView2Environment env)
    {
    await webView21.EnsureCoreWebView2Async();

Then window.open was resolved, but the problem recurred the next day.

  1. Change Desktop DPI and monitor settings
    not work

  2. Runtime , SDK , Edge Version Up ( check releas note )
    113.~~~ -> 126.0.2592.81

  3. Manually closing in form_closing
    WebView.Stop() -> WebView.Dispose()
    WebView.Dispose()
    not work

  4. change ntdll.dll file
    not work

e.ExitCode -1073740791
e.Reason Unexpected
e.ProcessFailedKind BrowserProessExited

Windows EventViewer -> ntdll.dll msedgewebview.exe

Now all that's left is to wait until the process is deleted, delete the data folder, set ExclusiveUserDataFolderAccess to true in options, and set the AdditionalBrowserArguments property, but to be honest, I don't feel like it will be solved.

Please let me know what else I can try. or code sample ( Environment or options etc )

If possible, I will submit a dump file. However, it may take time because the environment is difficult to export the file.

Importance

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

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

126.0.2592.81

SDK Version

126.0.2592.81

Framework

Winforms

Operating System

Windows 10

OS Version

21H2 19044.2728

Repro steps

  1. After running the form, open any URL or an empty URL with window.open using developer tools or a script.

  2. Open two apps and close one 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

@krleegw krleegw added the bug Something isn't working label Jul 16, 2024
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

1 participant