-
Notifications
You must be signed in to change notification settings - Fork 55
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
Unhandled Exception types occur during continuously running WinForms program #272
Comments
I have continued to test by continuously running my program in Auto mode using WebView2 version 0.9.538-prelease. After Chromium Edge Canary version 85.0.558.0 was installed, the unhandled exceptions noted in the original post no longer occurred. Prior to Chromium Edge Canary version 85.0.558.0, there would be several unhandled exceptions each day. After Chromium Edge Canary version 85.0.558.0 was installed, there have been no exceptions thrown in more than 120 hours of continuous testing. It looks like the Chromium Edge team has solved this issue. I think this issue can be closed. Thanks |
Thanks @mikemeinz, we appreciate the follow-up! Closing. |
I have same problem, I set
MainWindow.xaml.cs:
.NET 5 with Edge Dev 89.0.731.0 |
Unhandled exception types thrown by the WebView2 component
In Auto Mode, my WinForms program runs without user input repeatedly cycling through a ComboBox list of WebCam URIs. After running for some time, many times for several hours, a few different exception types occur that can't be trapped with Try..Catch blocks. During the times that these exceptions occur, the program is calling WebView2.Stop or assigning a URI to WebView2.Source.
The WinForms program is compiled in Release mode for .NET Framework 4.8 and is running as the only user app on a resource constrained Windows 10 Home Version 1909 (OS Build 18363.900) 32 bit OS, x64 Intel Atom CPU N450 1.66GHz processor with 1GB RAM.
Unhandled Exception Types
#1: The group or resource is not in the correct state - Program is able to reinitiate WebView2 and continue running.
#2 Error HRESULT E_FAIL has been returned from a call to a COM component - Program is able to reinitiate WebView2 and continue running.
#3 Object reference not set to an instance of an object. - Program is sometimes able to continue running.
#4 Unable to cast COM object - Program terminates
I tried using Try..Catch around the WebView2.Source assignment statements but that did not catch any of these exceptions. I removed the Try.. Catch and added an event handler for Application.ThreadException and an event handler for AppDomain.CurrentDomain.UnhandledException. The program attempts to resume by reinitiating WebView2 when certain thread exceptions occur.
Program Flow Description
The AutoDisplay() method is called by Timer_Tick() every 10 seconds. Within the AutoDisplay() method, WebView2.Stop is called, the ComboBox.SelectedIndex is set to the new index value and the ComboBox.SelectedItem value is assigned to WebView2.Source.
Snippets from the program
The Visual Studio project files are available upon request.
Initialization
Exception Handlers
Auto Mode Method called by Timer_Tick()
The text was updated successfully, but these errors were encountered: