无法找到所需的Cef / CefSharp依赖项 [英] Unable to locate required Cef/CefSharp dependencies

查看:717
本文介绍了无法找到所需的Cef / CefSharp依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个部署在客户端计算机上的C#控制台应用程序。在客户端计算机中部署时,出现System.TypeInitializationException。

I have a C# console application that is deployed on client machines. While deploying in client machine I get System.TypeInitializationException.

在debug.log中,出现以下错误:

In debug.log, I get the following errors:

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目录(如此处指定)中。因此,我不确定为什么没有加载这些文件。还有c:\myapp目录中包含的msvcp120.dll,msvcr120.dll,vccorlib120.dll

The problem is that all files are present in the C:\myapp directory (as specified here). Therefore, I'm not sure why these files aren't being loaded up. Also msvcp120.dll, msvcr120.dll, vccorlib120.dll included in c:\myapp directory

推荐答案

遵循官方快速入门文章设置任何CPU配置,打开 performDependencyCheck 时,我也遇到缺少依赖项的问题。

As many people, I followed the steps in the official Quick Start article to setup the "Any CPU" configuration and I had the same problem with missing dependencies when performDependencyCheck was on.

这是因为文章实际上是不完整的!

This is because the article is actually incomplete!

要使任何CPU配置正常工作,您需要遵循功能请求-添加AnyCPU支持#1714 (尤其是最后一个!):

For the "Any CPU" configuration to work, you need to follow all the steps in Feature Request - Add AnyCPU Support #1714 (especially the last one!):


  • Add <probing privatePath="x86"/> to your app.config as outlined in https://msdn.microsoft.com/en-us/library/4191fzwb.aspx
  • Set Prefer 32bit in your project properties see http://blogs.microsoft.co.il/sasha/2012/04/04/what-anycpu-really-means-as-of-net-45-and-visual-studio-11/ for some background
  • Set settings.BrowserSubprocessPath = @"x86\CefSharp.BrowserSubprocess.exe"; when calling 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 ,因为它现在仅报告真正的错误。

Note: when using this code, I would still advise you to use performDependencyCheck: true since it will now report only genuine errors.

这篇关于无法找到所需的Cef / CefSharp依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆