In Visual Studio 2019, using Nuget
, I have installed Microsoft.Web.WebView2
package.
PM> Install-Package Microsoft.Web.WebView2 -Version 0.9.430
As explained on Web, I have installed new Microsoft Edge Chromium Canary
version (it is important).
Now, when I open the Toolbox, I don't see any WebView2
control.
Before that, I have installed WebView
control (old version that is working with old Edge browser).
After installing WebView
, the control has been visible immediately in Toolbox.
But this is not the case with WebView2
control.
I have tried to add in Toolbox all controls from Microsoft.Web.WebView2
package manually.
But Visual Studio refuses to load WebView2Loader.dll
found in following folder
C:\Users\bernard\.nuget\packages\microsoft.web.webview2\0.9.430\build\x86
I have also tried with DLL found in
C:\Users\bernard\.nuget\packages\microsoft.web.webview2\0.9.430\build\x64
Is there possible to install WebView2 control in Toolbox ?
If yes, how ?
Then, go to Customization > Device Configuration > Modern Apps Settings. Select Microsoft Edge WebView2 and then clear the Enable automatic installation of WebView2 Runtime check box.
The Microsoft Edge WebView2 control allows you to embed web technologies (HTML, CSS, and JavaScript) in your native apps. The WebView2 control uses Microsoft Edge as the rendering engine to display the web content in native apps.
The WebView control shows web content in your Windows Forms or WPF desktop application. This is one of several wrapped Universal Windows Platform controls that are available for Windows Forms and WPF applications. For more information, see UWP controls in desktop applications.
WebView2Loader. dll is a small component that helps apps locate the WebView2 Runtime, or Microsoft Edge preview channels, on the device.
I also had this problem. I followed the instructions in the Getting Started tutorial:
https://docs.microsoft.com/en-us/microsoft-edge/webview2/gettingstarted/winforms
and installed Canary Edge as well, but the controls were still not appearing. However, it is interesting that the Microsoft.Web.WebView2.WinForms references were not showing up in the References of my Windows Form project initially. They are now appearing, but it is not clear why any of the following steps were necessary after initially simply using Nuget to installing Canary and the latest version of the WebView2 control.
After the third step, the library references to the WebView2 control appeared in my project References for the first time, and I was able to use them in the Form Designer.
NOTE: trying to update the control to the release version on 0.9.538 caused the references to disappear from the References and the WebView2 control was no longer available to the Form Designer. Reinstalling the prerelease solved the issue, so it appears the release of 0.9.538 supports a smaller scope than its prerelease.
TL;DR: do not update to the latest version of 0.9.538, just use the 0.9.538-prerelease.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With