Repository navigation
Frequently asked questions
- Why do I get an error about "Could not load file or assembly 'CefSharp.dll' or one of its dependencies. The specified module could not be found." when trying to run my CefSharp-based application? It compiles successfully, but does not run.
This is a common error which is caused by not all files being present in the output directory (bin\Debug or bin\Release, depending on which configuration you are running in Visual Studio). CefSharp.dll is a .NET-based DLL which is dependent on other .dll files, which in turn depends further on other .dll and other files...
Here is a listing of the minimum required files:
- libcef.dll (The core Chromium DLL, which basically contains the web browser + the CEF embeddability interface which we depend on)
- icudt.dll (Unicode DLL for Chromium, must also be present)
- CefSharp.dll (managed .NET assembly which contains the core CefSharp functionality)
- CefSharp.WinForms.dll OR CefSharp.WPF.dll (depending on your project type)
- VC2012 Redistributable Package (for running CefSharp on non developer machines)
You then need to initialize CEF with "PackLoadingDisabled = true", using code similar to the following:
var settings = new CefSharp.Settings
{
PackLoadingDisabled = true,
};
if (CEF.Initialize(settings))
{
// TODO: Set up your WebView here.
}
This means that the Chrome Developer Tools will be unavailable, which is normally OK for a production-mode application but not quite what you want when developing (web) applications. To make the Chrome dev tools work, add the following files also to the output:
- devtools_resources.pak
- locales (directory. Must contain en-US.pak at minimum)
The following files are optional and are used for audio, video, and WebGL:
- avcodec-54.dll
- avformat-54.dll
- avutil-51.dll
- libEGL.dll
- libGLESv2.dll