SteveSandersonMS / WebWindow

.NET Core library to open native OS windows containing web UI on Windows, Mac, and Linux. Experimental.
Apache License 2.0
1.99k stars 215 forks source link

Sample not working on Windows -- This article tells you how to resolve it #50

Open Dotneteer opened 4 years ago

Dotneteer commented 4 years ago

There are several issues in this site that mention the same problem (#1, #6, #42): it's not apparent how to get started with WebView in Windows. When you first try to run the samples, you get exception right from the WebWindow constructor.

All the resolved issues mention that you have to install Edge Beta from here https://www.microsoftedgeinsider.com/en-us/. Well, this is just a part of the solution.

I suggest to add this information to README:

Running WebWindow on Windows has these prerequisites, as of this writing:

  1. Edge Beta, as WebWindow uses the new Chromium-based Edge via webview2
  2. Microsoft Visual C++ 2015-2019 Redistributable

Those developers who use Visual Studio 2019 for .NET desktop development without the Desktop development with C++ workload installed, will still get the WebWindow constructor exception.

Follow these steps to run samples on your Windows machine:

  1. If you've installed Visual Studio 2019 on your computer, ensure that the Desktop development with C++ workload installed.
  2. Altentatively, if you do not want to install that workload, install Microsoft Visual C++ 2015-2019 Redistributable (x86: https://aka.ms/vs/16/release/vc_redist.x86.exe, x64: https://aka.ms/vs/16/release/vc_redist.x64.exe)
  3. Install Edge Beta (https://www.microsoftedgeinsider.com/en-us/.)

Now, the samples should work when running them from Visual Studio 2019/.NET CLI

benwurth commented 4 years ago

This fixed my problem with Visual Studio, but not when I use Visual Studio Code on Windows.

eivarin commented 4 years ago

Hey this is incorrect... The Edge Beta no longer has the webview 2 runtime. Please change it to the dev version or the cannary version. i explain why in #109

This issue should be pinned as it looks like it is essential for newcomers to this library

marcvannieuwenhuijzen commented 3 years ago

I just followed these instructions (download Edge Dev and install the Microsoft Visual C++ 2015-2019 Redistributable). Restarted and I am still getting the same error.

eivarin commented 3 years ago

@marcvannieuwenhuijzen can you post a print of the error?

milkotv commented 3 years ago

Hope this helps finding a resolution on Windows 7 Enterprise, SP1

image

image

image

image

image

image

hexck commented 2 years ago

Installed edge beta, no luck, still got the same issue.

System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'