WebView2 Deployment

Hal Roenick 0 Reputation points
2026-07-04T13:23:05.03+00:00

Hello,

I recently converted a VB.net (VS 2022) Desktop Application from a WebBrowser control to a WebView2 Control. I have everything working just as I would like. When I create an installer and include all of the dependencies then install my application, the application will not display the form that has the WebView2 control on it and I get this error...

Microsoft.Web.WebView2.WinForms, Version=1.0.4071.0, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' or one of its dependencies. The system cannot find the file specified.

When I look up this error, it tells me I am missing a dependency, but I have created a setup and included all of the dependencies. I have also tried to install the Evergreen version of the WebView2 files and that installer tells me all the WebView2 dependencies are already installed on my PC. Does anyone have a suggestion?

Thank you.

Developer technologies | VB
0 comments No comments

2 answers

Sort by: Most helpful
  1. Hal Roenick 0 Reputation points
    2026-07-04T14:03:05.5+00:00

    From what I can tell, all of the references mentioned above are installed on my system after I have installed my application. For example, WebView2Loader.dll is installed in all 3 of the runtimes folders mentioned (win-X86, win- X64 and win-arm64) in my application. My application is set to Any PC. As I mentioned above, my application works fine in the Visual Studio environment, but as soon as I deploy it and install it on my system, the problem persists.

    The WebView2Loader.dll files are loaded in this path...

    C:\Program Files (x86)\VCAMM Software\Golf League Pro\runtimes\win-x64\native

    ...and the .exe of my application is in this folder...C:\Program Files (x86)\VCAMM Software\Golf League Pro

    Thank you

    Was this answer helpful?


  2. AI answer

    2026-07-04T13:23:26.0933333+00:00

    The error indicates that the Microsoft.Web.WebView2.WinForms assembly (or one of its dependencies) is not being deployed with the application, even though the development machine has the Evergreen WebView2 Runtime installed.

    Two separate things must be present on the target machine:

    1. WebView2 Runtime (Evergreen or Fixed Version)
    2. WebView2 loader and .NET assemblies that your app directly references

    The Evergreen Runtime installer only installs the runtime, not the assemblies your app must ship.

    To fix deployment for a VB.NET WinForms app:

    1. Ensure WebView2 loader DLL is included
      For .NET managed apps, WebView2Loader.dll is a native, architecture-specific binary and must be shipped with the app:
         \<myApp>
             \runtimes
                 \win-arm64\native\WebView2Loader.dll (arm64)
                 \win-x64\native\WebView2Loader.dll (x64)
                 \win-x86\native\WebView2Loader.dll (x86)
      
      In Visual Studio Installer/Setup Project, explicitly add these files from the WebView2 SDK output (usually under runtimes\win-<arch>\native).
    2. Include the WebView2 .NET assemblies
      For a WinForms app, the following assemblies must be deployed alongside the EXE:
         Microsoft.Web.WebView2.Core.dll
         Microsoft.Web.WebView2.Winforms.dll
      
      Confirm that:
      • They appear in the app’s output folder on the build machine.
      • They are added as files in the installer project and installed to the same folder as your application EXE.
    3. Verify architecture alignment
      Make sure the architecture of:
      • Your app (x86/x64/AnyCPU),
      • WebView2Loader.dll variants,
      • And the installed WebView2 Runtime are consistent. For AnyCPU, include x86, x64, and arm64 loader DLLs under runtimes as shown above.
    4. If using Fixed Version runtime (optional)
      If choosing Fixed Version instead of Evergreen, the Fixed Version binaries must be packaged with the app and the environment configured before Source is set. For WinForms, this is done via CoreWebView2CreationProperties and BrowserExecutableFolder or via CoreWebView2Environment.CreateAsync in EnsureCoreWebView2Async.

    Once the installer is updated to deploy Microsoft.Web.WebView2.*.dll and the appropriate WebView2Loader.dll files with the application, the "system cannot find the file specified" error should be resolved.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.