wpf 加载 CEFSHARP.CORE.DLL 时出现异常
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29843119/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Exception loading CEFSHARP.CORE.DLL
提问by David Sundstr?m Sundstr?m
On someof 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.
在我们的某些机器上,尝试从 WPF 代码启动 CefBrowser 时会出现异常。我一直在尝试解决这个问题,但无法真正理解出了什么问题。这些机器都是运行64位操作系统的Win7。
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.)
下面,我使用运行“CefSharp.MinimalExample.Wpf.exe”的“Dependency Walker”捕获了跟踪。(我为格式道歉,我不知道如何改进它。)
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."
它开始,然后变成带有标准文本“无法加载文件或程序集'CefSharp.Core.dll'或其依赖项之一。找不到指定的模块”的appcrash。
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).
回答by amaitland
CefSharpis built using VC++ 2012 Update 4. Make note there a variants for x86and x64, so depending on your application make sure they match.
CefSharp是使用VC++ 2012 Update 4. 请注意x86和的变体x64,因此根据您的应用程序确保它们匹配。
https://www.microsoft.com/en-us/download/details.aspx?id=30679
https://www.microsoft.com/en-us/download/details.aspx?id=30679
When troubleshooting CefSharpsome places to start are
进行故障排除时,CefSharp一些开始的地方是
回答by Henry Otuadinma
For anybody still looking for a solution to this issue, Please the simplest thing to do is to download and install Visual C++ 2012 if you are using CefSharp from Version 55 downwards, and Visual C++ 2013 if you are using CefSharp version 57. Please ensure to install the VC++ build (x86 or x64) depending on your application target chitecture (build). This took me a day and half to realise.
对于仍在寻找此问题解决方案的任何人,如果您使用 CefSharp 55 版以下,请下载并安装 Visual C++ 2012,如果您使用 CefSharp 57 版,请下载并安装 Visual C++ 2013。请确保根据您的应用程序目标架构(构建)安装 VC++ 构建(x86 或 x64)。这花了我一天半的时间才意识到。
Have a look at this: https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions#Runtime_dependencies
看看这个:https: //github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions#Runtime_dependencies

