CefSharp-无法加载文件或程序集“ CefSharp.Core.dll”或其依赖项之一 [英] CefSharp - Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies
问题描述
我使用CefSharp WinForms应用程序已经有几周了,但没有任何问题。今天早上,在向应用程序添加一些内容的同时,我尝试运行它以测试某些内容并得到以下错误:
I've been working on a CefSharp WinForms app for a few weeks and I've had no issues with it. This morning, while adding a few things to the application, I tried to run it to test something and got the below error:
系统。 IO.FileNotFoundException未处理消息:
mscorlib.dll中发生了类型为'System.IO.FileNotFoundException'的未处理
异常。其他信息:无法加载文件或程序集
'CefSharp.Core。 dll或其依赖项之一。找不到指定的模块
。
System.IO.FileNotFoundException was unhandled Message: 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.
搜索了一会后,我发现:
After searching for a while I found this:
https://github.com/ cefsharp / CefSharp / wiki / Frequently-asked-questions#Runtime_dependencies
我检查了bin / Debug / x86项目,所有依赖项似乎都是当下。更重要的是,它在五分钟前运行良好,对于Entity Framework迁移,我只接触了一个类。
I checked bin/Debug/x86 for the project and all of the dependencies appear to be present. More importantly, it had been working fine five minutes earlier, and I didn't touch anything beyond a single class for an Entity Framework migration.
重建解决方案,重新启动Visual Studio,重新启动PC并清除/ bin / Debug,但这些都无济于事。
I've tried cleaning and rebuilding the solution, restarting Visual Studio, restarting my PC, and clearing out /bin/Debug, and none of these have helped.
为什么多次出现此错误现在会出现天没有它,如何解决这个问题?
Why would this error appear now after several days without it, and how can I resolve the issue?
编辑:我已经做了一些进一步的实验,我能够该应用程序以发布模式运行,而不是在调试模式下运行。如果我将发布模式的输出路径更改为调试,则它会失败并显示相同的错误(同样,它会在调试中使用发布输出路径成功)。
I've done some further experimenting and I'm able to get the application to run in Release mode but not Debug mode. If I change the output path of Release mode to Debug, it fails with the same error (likewise, it succeeds in Debug with the Release output path).
推荐答案
首先,确保安装了VC ++发行版:
First, make sure you installed the the VC++ distribution:
Cefsharp v65及更高版本,下载VC ++ 2015 Redist,较旧的CefSharp版本使用VC ++ 2013 Redist。
Cefsharp v65 and above, download VC++ 2015 Redist, older CefSharp versions use VC ++ 2013 Redist.
您可以从 https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads
第二,我之前没有看到有人提到过,在处理了几个小时后,我找到了这个解决方案:
Second, which I didn't see people mentioned this before, and i found this solution after I was working with the issue for several hours:
某些CefSharp版本需要CRT包。请在 C:\Program Files(x86)\Windows Kits\10\Redist\ucrt\DLLs 中找到它们,选择正确的版本文件夹(x86或x64,取决于您的CefSharp目标),将所有文件复制到项目的发布文件夹中。
Some CefSharp version needs CRT pack. Please find them at "C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs", choose the proper version folder (x86 or x64, depends on your CefSharp target), copy all files into the release folder of your project.
这篇关于CefSharp-无法加载文件或程序集“ CefSharp.Core.dll”或其依赖项之一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!