无法加载文件或程序集“ CefSharp.dll”或其依赖项之一 [英] Could not load file or assembly 'CefSharp.dll' or one of its dependencies
问题描述
我正在尝试使用CefSharp将Web应用程序加载到Winfoms中。我已将2个dll文件:CefSharp.dll和CefSharp.WinForms添加到引用中,并通过添加现有项将2个dll文件icudt.dll和libcef.dll添加到我的项目中。
I'm trying to use CefSharp to load my web app into winfoms. I've added 2 dll files: CefSharp.dll and CefSharp.WinForms into references and add 2 dll files icudt.dll and libcef.dll into my project through add existing items.
,这是$ b $形式的代码b
and this is the code from the form
public WebView web_view;
public Form1()
{
InitializeComponent();
web_view = new WebView("http://localhost:8084/wsmill",new CefSharp.BrowserSettings());
web_view.Dock = DockStyle.Fill;
toolStripContainer1.ContentPanel.Controls.Add(web_view);
CefSharp.CEF.Initialize(new Settings());
}
运行应用程序时,出现此错误
When run the app, I got this error
WindowsFormsApplication1.exe中的
发生了'System.IO.FileLoadException'类型的未处理异常
附加信息:无法加载文件或程序集' CefSharp.dll或其依赖项之一。动态链接库
(DLL)初始化例程失败。 (来自HRESULT的异常:
0x8007045A)
An unhandled exception of type 'System.IO.FileLoadException' occurred in WindowsFormsApplication1.exe Additional information: Could not load file or assembly 'CefSharp.dll' or one of its dependencies. A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A)
所以任何对此有所了解的人请帮助我,谢谢
So anyone who know about this please help me, thanks
推荐答案
您需要放置这些文件
libcef.dll
icudtl.dat
CefSharp.dll
CefSharp.WinForms.dll
进入您的 bin\Debug (或根据您的配置 bin\Release )
into your bin\Debug (or bin\Release base on your configuration)
并且请不要忘记安装 Visual C ++ 2012 Redistribution (自43版以来的Visual C ++ 2013 Redistributable),如果您不这样做,Visual Studio将始终显示异常,告诉您可以找到CefSharp.dll,尽管您已经拥有它!
And please do not forget to install Visual C++ 2012 Redistribution ( Visual C++ 2013 Redistributable since version 43), if you don't Visual Studio will always display an exception tell not found CefSharp.dll although you already have it!
希望获得帮助。
这篇关于无法加载文件或程序集“ CefSharp.dll”或其依赖项之一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!