WebWindow
WebWindow copied to clipboard
Sample not working on Windows -- This article tells you how to resolve it
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:
- Edge Beta, as WebWindow uses the new Chromium-based Edge via webview2
- 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:
- If you've installed Visual Studio 2019 on your computer, ensure that the Desktop development with C++ workload installed.
- 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)
- Install Edge Beta (https://www.microsoftedgeinsider.com/en-us/.)
Now, the samples should work when running them from Visual Studio 2019/.NET CLI
This fixed my problem with Visual Studio, but not when I use Visual Studio Code on Windows.
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
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.
@marcvannieuwenhuijzen can you post a print of the error?
Hope this helps finding a resolution on Windows 7 Enterprise, SP1
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.'