问题
This is probably a very simple question. I copied the example CefSharp MinimalExample.WinForms project to a new directory and renamed to WinProxy. It builds ok. When I run it I get;
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll Additional information: Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies. The specified module could not be found.
Comparing with the example directory, I am missing a number of files listed here https://github.com/cefsharp/CefSharp/wiki/Output-files-description-table-(Redistribution)
I do have CefSharp.Core.dll, CefSharp.WinForms.dll and CefSharp.dll which were all referenced in the example project.
How do I get the rest? I tried copying them over and rebuilding but I get;
An unhandled exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll Additional information: A procedure imported by 'CefSharp.Core.dll' could not be loaded.
Thanks.
回答1:
Install:
- Visual C++ Redistributable Packages for Visual Studio 2013
Check:
- CefSharp Version 49.0.1 require Framework 4.5.1.
- CefSharp Version 51.0.0 require Framework 4.5.2 or later.
Compile Solution:
- x86 or x64
回答2:
Try check whether you have all following dependencies included?
回答3:
After discussions with @amaitland I ended up uninstalling all NuGet packages and installing each package through the Package Manager Console;
Install-Package cef.redist.x86
Install-Package cef.redist.x64
Install-Package CefSharp.Common
Install-Package CefSharp.WinForms
It then worked.
来源:https://stackoverflow.com/questions/33869975/simple-cefsharp-application-is-missing-files-at-runtime