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]: CoreWebView2Controller.Close() sometimes hangs when disposing a windows forms webview2 browser control #4817

Open
peh-87 opened this issue Sep 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@peh-87
Copy link

peh-87 commented Sep 18, 2024

What happened?

We are using an instance of a WebView2 browser control within our application.
The Microsoft.Web.WebView2.WinForms.WebView2 control is embedded within a user control of our own.

When shutting down the application, it will sometimes hang within DestroyWindow, which is called within the EmbeddedBrowserWebView.dll triggered by CoreWebView2Controller.Close ().

The issue will only sometimes occur within our automated test system.

We already updated the sdk to the latest version and tried removing all event handlers from the webview2 control and the CoreWebView2 instance before calling dispose on the windows forms web view2 control. We also made sure that each instance of our software will use its own UserDataFolder, as we were experiencing other issues when sharing the UserDataFolder through multiple instances.

However the problem persists.

Is there anything else we can try or anything we can do to analyze this issue?

win32u.dll!NtUserDestroyWindow()	Unknown
EmbeddedBrowserWebView.dll!00007ff9f9d3a813()	Unknown
EmbeddedBrowserWebView.dll!00007ff9f9d42f70()	Unknown
EmbeddedBrowserWebView.dll!00007ff9f9d6ed8f()	Unknown
EmbeddedBrowserWebView.dll!00007ff9f9d42aaf()	Unknown
[Managed to Native Transition]	
Microsoft.Web.WebView2.Core.dll!Microsoft.Web.WebView2.Core.CoreWebView2Controller.Close()	Unknown
Microsoft.Web.WebView2.WinForms.dll!Microsoft.Web.WebView2.WinForms.WebView2.UnsubscribeHandlersAndCloseController(bool browserCrashed)	Unknown
Microsoft.Web.WebView2.WinForms.dll!Microsoft.Web.WebView2.WinForms.WebView2.Dispose(bool disposing)	Unknown
System.dll!System.ComponentModel.Component.Dispose()	Unknown

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

No response

SDK Version

1.0.2739.15

Framework

Winforms

Operating System

Windows 11

OS Version

No response

Repro steps

The problem is hard to manually reproduce, as it will only occur rarely on our automated test system

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

@peh-87 peh-87 added the bug Something isn't working label Sep 18, 2024
@sivMSFT
Copy link

sivMSFT commented Nov 22, 2024

Hi @peh-87,

We understand that this issue is critical and significantly impacts your app's user experience. Could you please confirm if you are still encountering this problem? If so, could you provide details on how frequently it occurs?

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

2 participants