-
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
[Problem/Bug]: InvalidOperationException: CoreWebView2 members cannot be accessed after the WebView2 control is disposed. #4272
Comments
This looks like a similar issue to #4206. It would be easier to debug if you can obtain a trace for us as well. |
@victorhuangwq Sorry I do not have this infomration. |
Based on #4206, it is very likely that the cause of the error is not something to do with WebView2, but rather the application using WebView2. As per the description of the stack trace, it is that the WebView2 control has been disposed, and yet the CoreWebView2 members are still being used by the application. Without a trace we can't figure out what's the cause for you. |
@victorhuangwq
Maybe the webview2 is disposing at another code path? Seems related to the following issues: Thank you. |
I'm having the same problem while using WebView2 with WPF. The problem occurs when I have a WebView2 inside a Window whose Owner is the WPF application MainWindow. When the MainWindow is closed I get the same error and stack trace as @cuiliang showed above. The error doesn't occur if the Owner of the webview window is not set. Here is a sample wpf project that reproduces the error: To reproduce the error, debug the application, click the button on the MainWindow (this opens the window that contains a WebView2) and then close the MainWindow. |
I've opened a bug for this on our backlog and am working on a fix now. |
@champnic we're seeing an issue with this in our production app that is causing a crash. Could you please provide on update on an ETA for a fix? |
Hey @pdolanjski - the fix is almost in and should be in the next prerelease SDK, which should ship around the end of this month. |
Since my ticket is linked to in this thread, is there any chance that this bug fix will resolve this issue? Can I know which pre-release build # I should look out for to test? |
@pdolanjski @benhbell It was just released recently in a prerelease SDK - can you test your scenarios with 1.0.2357-prerelease SDK and let me know if you run into the failure still, or other problems? |
Hi! I have added the pre-release to my project in Nuget ![]() but am running into the following problems trying to evaluate if it fixes the issue.
![]() ![]() ![]() |
When using a prerelease package you'll want to use a prerelease runtime as well (like Edge Canary), generally speaking. Did you make changes that use the new "ChannelSearchKind" property? |
you are right! Thanks. Will do that. |
Hey @champnic
I still see it loading the .22277 version loaded and the ChannelSearchKind issue. When you say changes, do you mean that there are more changes in the code needed than just referencing the canary build I installed using nugat? |
Did you install a non-release runtime, like the Edge Canary or Edge Dev browser? |
I managed to get a bit further in testing the pre-release, but not sure I have been successful in confirming that the pre-release is actually runnng (i still replicate the issue) |
I can confirmed that the issue looks to be addressed on our end when we test the new prerelease version. Thank you. |
@pdolanjski any chance you can validate or run the steps you took to update to the prerelease version? As well as how you verified it was using that version? Thanks. |
Sure. Note that we're bundling WebView2 with our app, not using the system one (and in this case we used 121.0.2277.106). From our developer:
Steps to test:
|
What happened?
Got some automatic exception report from multiple users.
The stacktracke shows it does not involve any user code.
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
No response
SDK Version
1.0.2210.55
Framework
WPF
Operating System
Windows 10, Windows 11
OS Version
10.0.22000.0, 10.0.18363.0, 10.0.22631.0 ...
Repro steps
Sorry, It's automatic report, so I dont have this information.
Repros in Edge Browser
No
Regression
Don't know
Last working version (if regression)
No response
AB#48471924
The text was updated successfully, but these errors were encountered: