WebView2Feedback icon indicating copy to clipboard operation
WebView2Feedback copied to clipboard

[Problem/Bug]: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.WebView2.WinForms

Open MasterCodeIT opened this issue 2 years ago • 4 comments

What happened?

Version=1.0.1938.49 same error Version=1.0.2045.28 same error Version=1.0.2088.41 same error

Any ideas? I cannot seem to find the fix to this.

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

1.0.1938.49

SDK Version

No response

Framework

Winforms

Operating System

Windows 10

OS Version

No response

Repro steps

Launching the windows form causes this. Error. Tried every method including installing webview runtimes.

Regression

Don't know

Last working version (if regression)

No response

MasterCodeIT avatar Oct 22 '23 18:10 MasterCodeIT

Hi @MasterCodeIT,

Can you check that the following assemblies are included in your build output?

WebView2Loader.dll
Microsoft.Web.WebView2.Core.dll
Microsoft.Web.WebView2.WinForms.dll

These assemblies must be located under the same directory as your app's exe, possibly under a architecture/platform subdirectory.

lflores-ms avatar Oct 23 '23 20:10 lflores-ms

Closing on lack of activity. Please reopen with further details if this is still an issue.

lflores-ms avatar Nov 17 '23 22:11 lflores-ms

Apologies as I was away on a trip.

Yes, assemblies were in the same directory

MasterCodeIT avatar Nov 17 '23 22:11 MasterCodeIT

Hi @MasterCodeIT,

Can you check that the following assemblies are included in your build output?

WebView2Loader.dll
Microsoft.Web.WebView2.Core.dll
Microsoft.Web.WebView2.WinForms.dll

These assemblies must be located under the same directory as your app's exe, possibly under a architecture/platform subdirectory.

We reproduce this issue with all versions since the 1.0.2651.64 version (included) if we build our installer with .Net8 and if (only if) the WebView2 SDK dependency is transitive.

We test with a direct dependency : the dll are copied to the output.

With a transitive dependency : dll are not copied (except WebView2Loader.dll) and we get a FileNotFoundException for Microsoft.Web.WebView2.Core.dll on runtime.

Julie-BC avatar Sep 16 '25 09:09 Julie-BC