Exception loading CEFSHARP.CORE.DLL

David Sundström Sundström picture David Sundström Sundström · Apr 24, 2015 · Viewed 8.7k times · Source

On some of our machines, we get an exception when trying to start CefBrowser from WPF code. I have been trying to troubleshoot this, but cannot really understand what goes wrong. The machines are all Win7 running 64-bit OS.

Below, I have captured a trace using "Dependency Walker" running the "CefSharp.MinimalExample.Wpf.exe". (I apologize for the formatting, I don't know how to improve it.)

It starts out, then turns into an appcrash with the standard text "Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies. The specified module could not be found."

So - does anyone know what to do next? I can't really guess!

Logfile from depends

> Loaded "RPCRTREMOTE.DLL" at address 0x000007FEFDCE0000.  Successfully hooked module.
DllMain(0x000007FEFDCE0000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "RPCRTREMOTE.DLL" called.
DllMain(0x000007FEFDCE0000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "RPCRTREMOTE.DLL" returned 1 (0x1).
LoadLibraryExW("f:\public\dsu\debug\CefSharp.Core.dll", 0x0000000000000000, LOAD_WITH_ALTERED_SEARCH_PATH) called from "CLR.DLL" at address 0x000007FEE80DDB40.
Loaded "CEFSHARP.CORE.DLL" at address 0x000007FEE2DA0000.  Successfully hooked module.
Unloaded "CEFSHARP.CORE.DLL" at address 0x000007FEE2DA0000.
LoadLibraryExW("f:\public\dsu\debug\CefSharp.Core.dll", 0x0000000000000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: The specified module could not be found (126).
GetProcAddress(0x0000000077300000 [KERNEL32.DLL], "LCIDToLocaleName") called from "CLR.DLL" at address 0x000007FEE80FDCE7 and returned 0x0000000077308680.
GetProcAddress(0x0000000077300000 [KERNEL32.DLL], "GetLocaleInfoEx") called from "CLR.DLL" at address 0x000007FEE80FDCE7 and returned 0x00000000773035E0.
LoadLibraryExW("C:\Windows\Microsoft.NET\Framework64\v4.0.30319\en-US\mscorrc.dll", 0x0000000000000000, LOAD_LIBRARY_AS_DATAFILE) called from "CLR.DLL" at address 0x000007FEE81652C4.
LoadLibraryExW("C:\Windows\Microsoft.NET\Framework64\v4.0.30319\en-US\mscorrc.dll", 0x0000000000000000, LOAD_LIBRARY_AS_DATAFILE) returned NULL. Error: The system cannot find the file specified (2).
LoadLibraryExW("C:\Windows\Microsoft.NET\Framework64\v4.0.30319\en\mscorrc.dll", 0x0000000000000000, LOAD_LIBRARY_AS_DATAFILE) called from "CLR.DLL" at address 0x000007FEE81652C4.
LoadLibraryExW("C:\Windows\Microsoft.NET\Framework64\v4.0.30319\en\mscorrc.dll", 0x0000000000000000, LOAD_LIBRARY_AS_DATAFILE) returned NULL. Error: The system cannot find the file specified (2).
LoadLibraryExW("C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorrc.dll", 0x0000000000000000, LOAD_LIBRARY_AS_DATAFILE) called from "CLR.DLL" at address 0x000007FEE81652C4.
Mapped "MSCORRC.DLL" as a data file into memory at address 0x0000000000590001.
LoadLibraryExW("C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorrc.dll", 0x0000000000000000, LOAD_LIBRARY_AS_DATAFILE) returned 0x0000000000590001.
GetProcAddress(0x0000000077300000 [KERNEL32.DLL], "LocaleNameToLCID") called from "CLR.DLL" at address 0x000007FEE80FDCE7 and returned 0x0000000077304FA0.
GetProcAddress(0x0000000077300000 [KERNEL32.DLL], "GetUserDefaultLocaleName") called from "CLR.DLL" at address 0x000007FEE8202730 and returned 0x000000007734BB80.
GetProcAddress(0x0000000077300000 [KERNEL32.DLL], "GetUserPreferredUILanguages") called from "CLR.DLL" at address 0x000007FEE82026F5 and returned 0x000000007734BB70.
LoadLibraryExW("C:\Windows\Microsoft.NET\Framework64\v4.0.30319\VERSION.dll", 0x0000000000000000, LOAD_WITH_ALTERED_SEARCH_PATH) called from "CLR.DLL" at address 0x000007FEE80DDB40.
LoadLibraryExW("C:\Windows\Microsoft.NET\Framework64\v4.0.30319\VERSION.dll", 0x0000000000000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: The specified module could not be found (126).
LoadLibraryExA("VERSION.dll", 0x0000000000000000, 0x00000000) called from "CLR.DLL" at address 0x000007FEE81226AC.
Loaded "VERSION.DLL" at address 0x000007FEFCE30000.  Successfully hooked module.
DllMain(0x000007FEFCE30000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "VERSION.DLL" called.
DllMain(0x000007FEFCE30000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "VERSION.DLL" returned 1 (0x1).
LoadLibraryExA("VERSION.dll", 0x0000000000000000, 0x00000000) returned 0x000007FEFCE30000.
GetProcAddress(0x000007FEFCE30000 [VERSION.DLL], "GetFileVersionInfoSizeW") called from "CLR.DLL" at address 0x000007FEE80E8131 and returned 0x000007FEFCE315FC.
LoadLibraryExW("CEFSHARP.MINIMALEXAMPLE.WPF.EXE", 0x0000000000000000, LOAD_LIBRARY_AS_DATAFILE | 0x00000020) called from "VERSION.DLL" at address 0x000007FEFCE31523.
...
Mapped "CEFSHARP.MINIMALEXAMPLE.WPF.EXE" as a data file into memory at address 0x000000013F400000.
LoadLibraryExW("f:\public\dsu\debug\CEFSHARP.MINIMALEXAMPLE.WPF.EXE", 0x0000000000000000, LOAD_LIBRARY_AS_DATAFILE | 0x00000020) returned 0x000000013F400000.
GetProcAddress(0x0000000077300000 [KERNEL32.DLL], "GetThreadErrorMode") called from "CLR.DLL" at address 0x000007FEE84A9C64 and returned 0x0000000077365620.
GetProcAddress(0x0000000077300000 [KERNEL32.DLL], "SetThreadErrorMode") called from "CLR.DLL" at address 0x000007FEE84A9C77 and returned 0x0000000077365660.
LoadLibraryExW("C:\Windows\Microsoft.NET\Framework64\v4.0.30319\diasymreader.dll", 0x0000000000000000, LOAD_WITH_ALTERED_SEARCH_PATH) called from "CLR.DLL" at address 0x000007FEE816BC48.
Loaded "DIASYMREADER.DLL" at address 0x000007FEE2C90000.  Successfully hooked module.
DllMain(0x000007FEE2C90000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "DIASYMREADER.DLL" called.
DllMain(0x000007FEE2C90000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "DIASYMREADER.DLL" returned 1 (0x1).
LoadLibraryExW("C:\Windows\Microsoft.NET\Framework64\v4.0.30319\diasymreader.dll", 0x0000000000000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned 0x000007FEE2C90000.
GetProcAddress(0x000007FEE2C90000 [DIASYMREADER.DLL], "DllGetClassObject") called from "CLR.DLL" at address 0x000007FEE816BC79 and returned 0x000007FEE2CA090C.
Second chance exception 0xE0434352 (Unknown) occurred in "KERNELBASE.DLL" at address 0x000007FEFE03AAAD.
Exited "CEFSHARP.MINIMALEXAMPLE.WPF.EXE" (process 0x18D4) with code -532462766 (0xE0434352).

Answer

amaitland picture amaitland · Apr 24, 2015

CefSharp is built using VC++ 2012 Update 4. Make note there a variants for x86 and x64, so depending on your application make sure they match.

https://www.microsoft.com/en-us/download/details.aspx?id=30679

When troubleshooting CefSharp some places to start are