CefSharp 3 always failing Cef.Initialize()
Asked Answered
B

1

3

I recently tried making the jump from CefSharp 1.25.7 to the most recent build (39.0.0-pre02). I got the files through NuGet but I copied them into my project separately since they have to be included in our repository to share with other developers. I believe I got all of the files (even got the new icudtl.dat file that seems to replace icudt.dll).

I was able to get all of the API changes resolved and added the new files and such. It builds and all of the dlls seem to be resolved but for some reason Cef.Initialize() (with and without settings) always fails. There are no errors in my output window or anything, just a false return. Any suggestions as to where I should be looking for the problem? I'm running VS2010, which I know had some issues building from source but I thought that using the binaries would get around that.

Bondswoman answered 17/2, 2015 at 16:52 Comment(0)
T
3

Sounds like you could be missing e.g. the CefSharp.BrowserSubprocess.exe and its dependent dlls in your bin/ folder. After Cef.Initialize() you should see that process spawned if you look in Windows Task manager. It's similar to all the Chrome.exe processes "That Google product variant" launches.

Compared to CefSharp 1 it's a quite different multiprocess beast under the hood. See https://github.com/cefsharp/CefSharp/wiki/Versions and it's pointer to the nice upstream CEF project documentation.

To quickly/more safely get off the ground use the CefSharp.MinimalExample repo as your reference. Its NuGet use should take care of copying all relevant files to your bin/ folder. Make sure your NuGet install in VS2010 is up to date.

Tile answered 17/2, 2015 at 22:55 Comment(3)
Thanks! I think I had all of the DLLs but forgot CefSharp.BrowserSubprocess.exe. The odd thing is that it still fails initialize but the browser seems to work and pages show up... Also it seems like the default scrollbars are very red. Any idea why/how to change that?Bondswoman
Ah figured out the red scrollbars, I was missing the .pak files (I thought that was just a NuGetey thing... Still curious how it can fail initialize but still work though.Bondswoman
:-) The NuGetey ones are "nup-kegs" .nupkg ... Chrom[e|ium] and CEF'ey ones are .pak files. And apparently some time in the start of rev 30-something with CEF the red scrollbars etc. started showing up with DisablePackLoading ... I'll go and nuke a few references to the option now as it creates more annoyance than light-weightness nowadays. Starting with the CefSharp FAQ.Tile

© 2022 - 2024 — McMap. All rights reserved.