[Problem/Bug]: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.WebView2.WinForms
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
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.
Closing on lack of activity. Please reopen with further details if this is still an issue.
Apologies as I was away on a trip.
Yes, assemblies were in the same directory
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.dllThese 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.