Home > front end >  WebView2 browser don't load the webpage, just a white window is shown
WebView2 browser don't load the webpage, just a white window is shown

Time:09-30

I have built a program in Visual Studio 2019 where I use WebView2 as a browser. When I test the program on the computer where I have VS 2019 installed, it works as it should. But when I test it on another computer, I only get a white box. What am I doing wrong?

In VS 2019, I select "Build> Publish [My file]> Folder>" and click on "Publish". I copy the files and the "runtime" folder to another computer.

I have installed both "windowsdesktop-runtime-5.0.10-win-x64.exe" and "windowsdesktop-runtime-5.0.10-win-x86.exe" on the computer where it does not work.

Dim filePath1 As String
filePath1 = "https://stackoverflow.com/"
WebBrowser.Source = New Uri (filePath1)

CodePudding user response:

To distribute your application that uses WebView2 you'll need to additionally distribute the WebView2 Runtime.

You can either use the evergreen installer which will install the runtime on that machine including an updater that will keep the runtime up to date or you can use fixed version in which you ship a copy of the WebView2 Runtime with your application and you are responsible for keeping it up to date. You can read more about these options in the WebView2 distribution documentation

  • Related