Description
Description
I have a WPF app using .NET Framework 4.7.2, that contains multiple WebView2 instances. Intermittently, we get an app crash during the finalize of the WebView2 control
Here is the error from Windows Event Viewer.
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
at System.Windows.Threading.Dispatcher.VerifyAccess()
at Microsoft.Web.WebView2.Wpf.WebView2.get_CoreWebView2()
at Microsoft.Web.WebView2.Wpf.WebView2.Dispose(Boolean)
at System.Windows.Interop.HwndHost.Finalize()
I can't find any way to prevent this from happening.
Version
WebView2 1.0.721-prerelease
.NET Framework 4.7.2
Repro Steps
I believe it eventually happens after a user opens a window with a WebView2 and then closes it. We dispose of the WebView2 instance, but a little while later, the app crashes (during the finalize process).
Screenshots
Additional context