MicrosoftEdge / WebView2Samples

Microsoft Edge WebView2 samples
830 stars 460 forks source link

VCRUNTIME140_1.dll was not found #178

Open icnocop opened 1 year ago

icnocop commented 1 year ago

Hi.

Thank you for WebView2Samples.

When running WebView2SampleWinComp.exe on a machine without the Visual C++ runtime, the following error occurs:

---------------------------
WebView2SampleWinComp.exe - System Error
---------------------------
The code execution cannot proceed because VCRUNTIME140_1.dll was not found. Reinstalling the program may fix this problem. 
---------------------------
OK   
---------------------------

The requirement to download and install the Visual C++ runtime should be documented.

For example, on Windows Server 2019, I had to install the x64 version: https://aka.ms/vs/17/release/vc_redist.x64.exe

Source: https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022

Thank you.

champnic commented 1 year ago

Hey @icnocop - Thanks for the report! We do list Visual Studio 2019 with C++ support as a prereq for the WinComp sample. Did you have this step but it doesn't include the Visual C++ runtime? If so, I'll add the runtime to that list of prereqs. https://learn.microsoft.com/en-us/microsoft-edge/webview2/samples/webview2samplewincomp#step-2---install-visual-studio-with-c-support

icnocop commented 1 year ago

Hi @champnic

The steps on that page are for building the sample application, although I didn't need to install a preview channel of Microsoft Edge in order to build or run the sample application.

In any case, the issue occurs if I build the sample application on my development machine, and then copy the binaries and try to run the sample application on a different machine.

Thank you.