Skip to content
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 not working after latest update to Visual Studio #540

Closed
rtsessions opened this issue Oct 16, 2020 · 9 comments
Closed

WebView2 not working after latest update to Visual Studio #540

rtsessions opened this issue Oct 16, 2020 · 9 comments

Comments

@rtsessions
Copy link

I just started working with the WebView2 control in a WPF application. I created a separate window that contains the WebView2 control based on the get started article. I bind the source to a property in the view model.

It was working as intended until I updated Visual Studio 2019 to the latest version.

Version 16.7.6. .Net version 4.8.04084

The window will load and the Source property is loaded from the model but the web page never shows.

I uninstalled the WebView2 NuGet package and re-installed it. This did not correct the situation.

When I attempt to manually navigate to a page after the window is loaded the CoreWebView2 is null.

    public void DisplayPage(string pURL)
    {
        if (webView != null && webView.CoreWebView2 != null)
        {
            webView.CoreWebView2.Navigate(pURL);
        }

    }
@champnic
Copy link
Member

If you set the Source property to a constant (rather than the binding) does that work? I'm trying to understand if it's the WebView2 that got busted or the binding.

Also, what version of Edge/runtime are you using? It's possible if you are using Canary that it got updated to 88.0.670+, and then you may be hitting #535. If that's the case, you can switch to using Dev or Beta build.

@SameAsUsually
Copy link

Had the same problem. I can confirm that installing the beta fixes the problem for the mean time.

@rtsessions
Copy link
Author

Switching to the Dev version of Edge corrects the issue.

Thanks for the suggestion.

@monkeypro
Copy link

monkeypro commented Nov 6, 2020

For me it did not help to switching to BETA or DEV
If my binded Source property is set/changed after the view is initialize it has no effect

@champnic
Copy link
Member

champnic commented Nov 9, 2020

@monkeypro It might help to open a new issue? I'm guessing you're running into something similar but different. It would help if you could provide SDK version, runtime version, repro steps, etc. Thanks!

@monkeypro
Copy link

I have opened a new issue #619

@ayushswiss
Copy link

I have made a sample application which is very easy to understand and user friendly.

Visit and download the sample https://github.com/ayushswiss/EdgeBrowserByAyush

@bonesmasher
Copy link

How do you install the beta / dev build??

@champnic
Copy link
Member

You can get Microsoft Edge Canary/Dev/Beta here:
https://www.microsoftedgeinsider.com/en-us/download/

And then tell WebView2 to use it by setting the WEBVIEW2_RELEASE_CHANNEL_PREFERENCE environment variable to "1" in your app before initializing the WebView2 control. For example in .NET:
Environment.SetEnvironmentVariable("WEBVIEW2_RELEASE_CHANNEL_PREFERENCE", "1");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants