gpt4 book ai didi

c# - CefSharp - 无法加载文件或程序集 'CefSharp.Core.dll' 或其依赖项之一

转载 作者:太空狗 更新时间:2023-10-29 23:29:04 25 4
gpt4 key购买 nike

我已经在 CefSharp WinForms 应用程序上工作了几个星期,并且没有遇到任何问题。今天早上,在向应用程序添加一些东西时,我试图运行它来测试一些东西并得到以下错误:

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.

经过一段时间的搜索,我发现了这个:

https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions#Runtime_dependencies

我检查了项目的 bin/Debug/x86,所有依赖项似乎都存在。更重要的是,它在五分钟前运行良好,除了 Entity Framework 迁移的单个类之外,我没有触及任何东西。

我尝试过清理和重建解决方案、重新启动 Visual Studio、重新启动我的 PC 并清除/bin/Debug,但这些都没有帮助。

为什么在没有它的情况下几天后会出现此错误,我该如何解决该问题?

编辑:我做了一些进一步的实验,我能够让应用程序以 Release模式而不是 Debug模式运行。如果我将 Release 模式的输出路径更改为 Debug,它会失败并出现相同的错误(同样,它会在 Debug 中使用 Release 输出路径成功)。

最佳答案

首先,确保您安装了 Microsoft Visual C++ Redistributable:

  • 版本 v93 及更高版本:使用 Microsoft Visual C++ 2019 Redistributable 或更高版本
  • 版本 v65 - v92:使用 Microsoft Visual C++ 2015 Redistributable 或更高版本
  • 旧版本:使用 Microsoft Visual C++ 2013 Redistributable(确切版本)

您可以从 Microsoft 下载 Visual C++ Redistributable .参见 C++ binary compatibility between Visual Studio versions有关版本兼容性的更多详细信息。

确保匹配正确的架构,如果您的应用程序是x64,您需要安装Visual C++ Redistributable 的x64 版本。同样,如果您的应用程序是 x86,那么您需要安装 Visual C++ Redistributable 的 x86 版本。

Microsoft Visual C++ Redistributable 依赖于 Universal CRT .通用 CRT 作为 Windows 10/11 的一部分包含在内。在旧版本的 Windows 上,Visual C++ Redistributable 将安装 Universal CRT

对于那些希望在他们的应用程序中包含 Visual C++ Runtime 的人来说,从技术上讲可以 include the runtime与您的应用程序。另见 Local DeploymentDeployment in Visual C++来自微软的文章。

关于c# - CefSharp - 无法加载文件或程序集 'CefSharp.Core.dll' 或其依赖项之一,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42365731/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com