-
Notifications
You must be signed in to change notification settings - Fork 51
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
Application crashes #333
Comments
We completely understand your frustrations with WebBrowser component and CefSharp. This pre-release package is our first release of .NET binaries and is very much a work in progress until we GA. We plan to update our package every 6 weeks and would love for you to stay engaged and help us find bugs and suggest features as we work to develop a better product. |
Okay, thank you for your response! The current state of this pre-release package got me a bit worried when attempting to integrate it into our existing product. I mean it probably works for most simple programs but our application is not quite that simple. I'll file additional detailed bug reports with a reproducible example where possible for all bugs I encounter. |
Any quick comments on this particular error message would be greatly appreciated:
I've spent practically the entire day debugging this and still haven't managed to create a reproducible example, all I've got is the following:
|
@fvanheeswijk Thanks for trying out WebView2! We really appreciate the bug reports. Would you mind filing a separate GitHub issue for each bug you run into? It makes it easier to track and investigate on our end. As much info/code samples you can give will help us to reproduce and track down the issue as well. For that stack, can you tell which controls are trying to set visibility on the WebView2? Is it setting visibility to true or false? It seems like this visibility call is trying to use the WebView2 after it has already been destroyed. |
Haven't heard back in a month, so closing this issue. If you have more details or want us to take another look please reopen. Thanks! |
This issue indeed does not reproduce anymore with the latest version of WebView2. However, we also changed parts of our own codebase, so I cannot determine if it's really fixed, but for us it is not an issue anymore. |
Hi I also encountered the same issue with pre-release 1.0.647: "System.Runtime.InteropServices.COMException (0x8007139F): The group or resource is not in the correct state to perform the requested operation. (Exception from HRESULT: 0x8007139F)\r\n The webview2 WPF browser is used in a WPF UserControl wrapper (Com visible) and loaded in runtime by another main application as embedded view. The exception occurs when the main application is closed. Environment: |
@yu-zhou-tfs WebView2 is single threaded - can you confirm that the visibility call is happening on the same thread that the WebView2 was created on? You may need to call Dispose on the WebView2 when the main application is closing. That should clean up the CoreWebView2 object and remove the handler to IsVisibleChanged. |
I am experiencing the same issue. The WebView2 is in a WPF application on a form that is opened with ShowDialog. When the form closes, Dispose on the WebView2 is called in the Closing event of the form. System.Runtime.InteropServices.COMException Environment:
|
Hi the main application is a older Win Form application that we may not be able to change. I wrote a small Win Form app to load the same WebView2 WPF browser (in a separate assembly) during run time. Same exception happens when the Win Form application is closed. It's caused by the base.Dispose() generated by designer. protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing); // Exception raised here. Does the Dispose let GC finalizer thread to dispose WebView2 (as COM object) in this case?
} Within the Win Form I used If I added a call to explicitly to dispose the ElementHost, the exception would go away. protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
DisposeControls();
base.Dispose(disposing);
}
private void DisposeControls()
{
if (m_wpfControlHost != null)
{
m_wpfControlHost.Dispose(); // This would dispose WebView2 in the same UI thread?
this.Controls.Remove(m_wpfControlHost);
m_wpfControlHost = null;
}
} I don't know how to work around this as the legacy Win Form application cannot be changed. Please advise. |
I see a similar issue, created one at #816 |
Hello,
We are working on a complex product which uses web views internally to show webcontent, for this the WebBrowser component from WinForms is being used. But it has aged, has numerous issues and doesn't contain new innovations so logically we want to switch over to a newer product.
In the last years we have on and off done research and tried CefSharp3 at first and now the Essential Objects browser, they are all quite good but don't exactly cut it to go into production for all of us customers.
Now we are trying to see if this new promising WebView2 will be a nice fit but I'm seeing some worrying issues unfortunately. I don't know how much needs to be attributed to the fact that it still is a prerelease.
The major issue is that if something crashes the whole application crashes, whereas with CefSharp3 and Essential Objects only one specific browser window would crash but the application (together with other browser windows) would survive.
Soon I'll start digging into the more specific errors we are getting but for now these are the most common ones:
Exception : System.Runtime.InteropServices.COMException (0x8007139F): The group or resource is not in the correct state to perform the requested operation. (Exception from HRESULT: 0x8007139F)
When we dispose the WebView2 when we close the form we get various unexpected errors. For now we have decided to not dispose, but is that correct usage?
System.Runtime.InteropServices.COMException (0x8007139F): The group or resource is not in the correct state to perform the requested operation. (Exception from HRESULT: 0x8007139F)
It may also be that we are partially the cause for our application crashes because we do not properly handle the exceptions, but how do we know whether an exception has originated from WebView2 and can thus be 'relatively safely' be discarded and when it would be an exception (which may also be a COMException) that has originated from other parts of our codebase and would result in an unstable program.
AB#27617140
The text was updated successfully, but these errors were encountered: