-
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
In WPF, calling dispose in WebView2 component from ProcessFailed event context will raise an exception #996
Comments
Hey there's a fix in the works for this issue but it's taking longer than expected to turn around. Thank you for the repro app because when we tried calling Dispose in ProcessFailed ourselves, there were no issues. I'll be investigating your app and get back to you soon. |
Hey @neidantaslopez just tried out your app and it indeed repros on 88.0.705.81 but I found it's fixed in 90.0.803.0 which is the current Edge Dev version. Could you please see if running a newer runtime fixes your scenario? You can have your app favor loading Edge Dev or Canary by setting the environment variable with this command: Environment.SetEnvironmentVariable("WEBVIEW2_RELEASE_CHANNEL_PREFERENCE", "1"); |
@johna-ms it worked on Canary 90.0.803.0. When could we expect the fix to be on Evergreen WebView2 Runtime and Fixed Version WebView2 Runtime? |
Good news, the fix should be in the latest of both runtimes in just a couple days on 3/4 :) Please update here if that's not the case! |
Thanks for your good work. |
Happy to help! Glad things are working. @neidantaslopez are things alright with you? Just want to confirm so I can close out this issue. |
It's OK now. Thank you. |
Description
In WPF, calling dispose in WebView2 object from ProcessFailed event context will raise the following exception:
Message = "The group or resource is not in the correct state to perform the requested operation. (Exception from HRESULT: 0x8007139F)"
StackTrace = " at Microsoft.Web.WebView2.Core.Raw.ICoreWebView2.remove_ContentLoading(EventRegistrationToken token)\r\n at Microsoft.Web.WebView2.Core.CoreWebView2.remove_ContentLoading(EventHandler`1 value) in D:\a\1\s\third_party\edge_webview2\win\webview2_api_writer\dotNetAPIWrapper\Microsoft.Web.WebView2.Core\obj\PrereleasePackage\Generated.cs:line 5324\r\n at Microsoft.Web.WebView2.Wpf.WebView2.Dispose(Boolean disposing)\r\n at System.Windows.Interop.HwndHost.Dispose()\r\n at WpfAppWebView2Dispose.MainWindow.CoreWebView2_ProcessFailed(Object sender, CoreWebView2ProcessFailedEventArgs e) in C:\r\WpfAppWebView2Dispose\MainWindow.xaml.cs:line 52"
Version
SDK: either 1.0.790-prerelease or 1.0.705.50 reproduce the same issue
Runtime: either Evergreen WebView2 Runtime 88.0.705.81 or Fixed Version WebView2 Runtime 88.0.705.81 reproduce the same issue
Framework: WPF, .NET Framework 4.6.2
OS: either Win10 or Win7 reproduce the same issue
Repro Steps
By the references bellow, I understand the behavior mentioned above is incorrect (Dispose should work fine and no exception should be raised):
#774 (comment)
#799
https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1065#dispose-methods
AB#31870655
The text was updated successfully, but these errors were encountered: