-
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
"WebView2 was already initialized with a different CoreWebView2Environment" #1782
Comments
me too. anyone has a solution?it troubles me a lot. |
Yes, me too. Please fix. Also: when I try to use EnsureCoreWebView2Async without an environment it seems to be working up to a point. It stops working when I then try to use it in an Outlook Addin. From the little information I can glean it seems like it's already set up with its own environment then (I am guessing by Outlook itself?), but when I then try to use a WebView2 in my own Add-in on, say, a WPF form it fails because it doesn't have permissions to write to the Outlook WebView folder (in my case "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE.WebView2"). I can get it to work then by giving full permissions to "everyone" on that folder, but I can't burden our support staff to do that for every user they need to install our software for, and since we also provide software for larger organisations I know that their IT support teams will not accept that "solution" either. The problem goes away when I revert back to nuGet package 1.0.961.33 |
I have the same issue. I want to add that I am absolutely sure passing the same environment in both calls to EnsureCoreWebView2Async. I understand the comparison is made by reference, and mine didn't change. Looking at the WebView2 code, I could not figure out where is there reference for Environment set. But according to the release notes: Why is it happening on the latest stable? |
This is a duplicate to #1782. The easiest workaround is to use WebView2.CoreWebView2.Navigate instead of setting the source property. Or use 1.0.961.33 SDK package. @tiagoabreu The confusion here stems from how our branches work internally. This change was committed to our version 982, but our first prerelease package after that was 1010. However, we forked for stable release branch around version 992, which also included the change (because > 982). I'll open this as a bug to see if we can improve process or add documentation around our versioning to explain this better. |
@GJStarCode If that is throwing a null reference, that means the WebView2 has not finished initializing. Are you |
@GJStarCode Can you take this info and create a new GitHub issue? This looks different than the original issue here. It's also interesting that it only repros when run from the exe, and not from Visual Studio. |
Hi Nic I've created a new issue, i'll clean this one |
Description
Since 1.0.992.28, I'm unable to use
EnsureCoreWebView2Async(env)
, webview throws an exception when I try to set theSource
property for the first time.Version
SDK: 1.0.992.28
Runtime: 96.0.1031.0
Framework: WPF
OS: Win10 2004
Repro Steps
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: