无法找到所需的Cef/CefSharp依赖关系
我有一个C#控制台应用程序部署在客户机上。在客户机中部署时,我得到System.TypeInitializationException。无法找到所需的Cef/CefSharp依赖关系
在的debug.log,我得到以下错误:
Unable to locate required Cef/CefSharp dependencies:
Missing:CefSharp.BrowserSubprocess.exe
Missing:CefSharp.BrowserSubprocess.Core.dll
Missing:CefSharp.Core.dll
Missing:CefSharp.dll
Missing:icudtl.dat
Missing:libcef.dll
Executing Assembly Path:C:\myapp
的问题是,所有的文件都存在于C:\ MYAPP目录(这里指定)。因此,我不确定为什么这些文件没有被加载。此外msvcp120.dll,msvcr120.dll,vccorlib120.dll包含在c:\ myapp目录中
我有同样的问题。首先我看到Cef.Initialize()函数只是不工作,所以我能像这样performDependencyCheck选项:
Cef.Initialize(BrowserSettings, performDependencyCheck: true, browserProcessHandler: null);
,我看到我缺少一些文件。
之后,错误一直显示,即使我不会错过任何东西。所以我禁用了performDependencyCheck选项和它的工作(是这样的:
Cef.Initialize(settings, performDependencyCheck: false, browserProcessHandler: null);
希望它会帮助你
55.0.0软件包具有gitlink支持,因此您可以轻松调试开发机器上的源代码。 https://开头github上。com/GitTools/GitLink#gitlink – amaitland
我也试图禁用performDependencyCheck,但后来我意识到我无法在主框架中执行JavaScript。所以我会劝阻这样做。请参阅我的回答。 –
正如许多人,我也跟着在官方Quick Start article设置了“任何CPU”的步骤。配置和我有同样的问题缺少依赖时performDependencyCheck
开始了。
这是因为文章实际上是不完整的!
对于“任何CPU”的配置工作,你需要遵循所有在Feature Request - Add AnyCPU Support #1714的步骤(特别是最后一个!):
01下面
- 添加
<probing privatePath="x86"/
>您app.config
在https://msdn.microsoft.com/en-us/library/4191fzwb.aspx- 在你的项目属性设置
Prefer 32bit
概述看到http://blogs.microsoft.co.il/sasha/2012/04/04/what-anycpu-really-means-as-of-net-45-and-visual-studio-11/ 一些背景- 套装
settings.BrowserSubprocessPath = @"x86\CefSharp.BrowserSubprocess.exe";
致电时Cef.Initialize
例如:
[STAThread] public static void Main() { var settings = new CefSettings(); settings.BrowserSubprocessPath = @"x86\CefSharp.BrowserSubprocess.exe"; Cef.Initialize(settings, performDependencyCheck: false, browserProcessHandler: null); var browser = new BrowserForm(); Application.Run(browser); }
注:使用此代码的时候,我还是会建议你使用performDependencyCheck: true
,因为它现在将仅报告真正的错误。
我会离开performDependencyCheck在真 –
是的你说得对,performDependencyCheck应该保持“真”。我刚刚引用了票证中的例子。但我会添加一个不是我的答案。谢谢 –
请参阅http://stackoverflow.com/help/mcve – amaitland
您可以禁用依赖项检查,它是Cef.Initialize的一个参数 – amaitland
@amaitland在恢复我的代码以再次模拟它之后,问题消失,因此可能与环境有关。 – 2017-01-09 05:46:32