I'm new to CEF, and was trying out Xilium, CefSharp, and even webkitdotnet (
https://github.com/webkitdotnet/webkitdotnet), the last of which was pretty easy to get up and running.
Using Xilium, I ran into some issues figuring out how to configure the libcef.dll.
In CefRuntime.cs's Load() method, BuildRevision from the below snippet is doing one of two things.
var rev = BuildRevision;
if (rev != libcef.CEF_REVISION) throw ExceptionBuilder.RuntimeVersionMismatch(rev, libcef.CEF_REVISION);
Straight out of the box, it was throwing the following error:
System.DllNotFoundException was unhandled
Message=Unable to load DLL 'libcef': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Source=Xilium.CefGlue
TypeName=""
StackTrace:
at Xilium.CefGlue.Interop.libcef.build_revision()
at Xilium.CefGlue.CefRuntime.get_BuildRevision() in D:\Projects\chromeige\xilium.cefglue\CefGlue\CefRuntime.cs:line 247
at Xilium.CefGlue.CefRuntime.Load() in D:\Projects\chromeige\xilium.cefglue\CefGlue\CefRuntime.cs:line 81
at Xilium.CefGlue.Demo.DemoApp.Run(String[] args) in D:\Projects\chromeige\xilium.cefglue\CefGlue.Demo\DemoApp.cs:line 46
at Xilium.CefGlue.Demo.Program.Main(String[] args) in D:\Projects\chromeige\xilium.cefglue\CefGlue.Demo.WinForms\Program.cs:line 14
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
That makes enough sense; libcef isn't in there.
So I copied a version of libcef I had laying around (File version 1.1084.728.0) into...
\xilium.cefglue\CefGlue.Demo.WinForms\bin\Debug
... which seemed to be the best place for it. I think it's found, but now I'm getting the second error...
System.BadImageFormatException was unhandled Message=An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Source=Xilium.CefGlue
StackTrace:
at Xilium.CefGlue.Interop.libcef.build_revision()
at Xilium.CefGlue.CefRuntime.get_BuildRevision() in D:\Projects\chromeige\xilium.cefglue\CefGlue\CefRuntime.cs:line 247
at Xilium.CefGlue.CefRuntime.Load() in D:\Projects\chromeige\xilium.cefglue\CefGlue\CefRuntime.cs:line 81
at Xilium.CefGlue.Demo.DemoApp.Run(String[] args) in D:\Projects\chromeige\xilium.cefglue\CefGlue.Demo\DemoApp.cs:line 46
at Xilium.CefGlue.Demo.Program.Main(String[] args) in D:\Projects\chromeige\xilium.cefglue\CefGlue.Demo.WinForms\Program.cs:line 14
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
I think, based on some Googling and stumbling over this post:
https://groups.google.com/forum/#!searchin/cefglue/xilium/cefglue/D5XL0uBY3MY/nx2RsfSZB9gJ... that I've got the wrong version of libcef.dll. So I'm pretending that I'm looking for 1102, since that's what libcef.CEF_REVISION evals to right now.
So I grab what looks like the right thing from cef_binary_3.1384.1102_windows_xilium.7z\Debug\ --
it's file version 3.1384.1102.0.
Same BadImageFormatException. That makes some sense, since it's not like I was receiving the wrong version for the other libcef file; CefRuntime.BuildRevision didn't work.
Is the dll supposed to go somewhere else? Seems that since it's found (and wasn't found before), that I'm okay there, even if placement is suboptimal. Am I missing a reference?
Sorry for the dll n00bness; I'm usually a web or clean Windows.Forms .NET guy. I haven't waded into C or dlls (past a little play with Noesis.Javascript.dll) since the VB6 and Dan Appleman days.
Thanks,
Ruffin Bailey