Problem updating from version 37 to 39

63 views
Skip to first unread message

Doug Miller

unread,
Jun 19, 2015, 11:06:47 AM6/19/15
to cefs...@googlegroups.com
I have been using winforms version 37.0.1 (x86) for awhile now.  I am trying to upgrade to 39.0.2 but running into a problem.

I have downloaded the source for 39.0.2, run nuget restore, successfully built and ran the winforms example.

I then copied ALL the file from the winforms example bin to my solution ( libcef, cefsharp.browser,subprocess.exe, and everything else).

I changed the references in my solution to point to new versions of CefSharp, CefSharp.Core and CefSharp.Winforms.

I am able to compile my solution successfully, but everytime I run it Cef.Initialize() (with not settings) returns false.

I have also tried using the 39.02 binaries installed directly from nuget - I had same error with those.

I feel like I am missing a step?  But I can't figure out what it may be?

Alex Maitland

unread,
Jun 20, 2015, 12:39:29 AM6/20/15
to cefs...@googlegroups.com
Without more information it's really hard to say. In general I wouldn't recommend building from source. If you do go down that path then make sure you read the `Note` in https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions#6-how-do-i-include-the-visual-studio-c-2012-redistributables-on-the-target-app

You can see a working example using the nuget packages at https://github.com/cefsharp/CefSharp.MinimalExample

The dependency checking option should help make sure you have all the relevant files see https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Example/CefExample.cs#L87

You should see what the `debug.log` file produces, it should be in your bin folder.

Doug Miller

unread,
Jun 23, 2015, 11:37:39 AM6/23/15
to cefs...@googlegroups.com
I have tried building from source from both the main branch example project, and now the minimal project.  In both cases I am able to build and run the winform examples.  But in both cases when I try to use those files in my project CEF.Initialize returns false.

The same is true when I use the binaries from the nuget package without building.

This is my call to CEF.Initialize

            bool success = Cef.Initialize(cefSettings, shutdownOnProcessExit: true, performDependencyCheck: true);

            if (success == false)
            {
                throw new Exception("failure initializing CEF");
            }


BUT ... I just noticed that if I don't throw the exception, the app runs fine, even when success is false!

When that happens the only thing in the debug file is:

[0623/112820:ERROR:renderer_main.cc(207)] Running without renderer sandbox

So, my question is ... should I expect any problems running if CEF.Initialize returns false?



Doug Miller

unread,
Jun 23, 2015, 3:13:57 PM6/23/15
to cefs...@googlegroups.com
Well I have found a problem in this scenario.  Though the app runs under these circumstances, it does not apply my cefsettings.  It does not use my cachePath, or enable remote debugging, or accept proxy settings (via CEF command line args).  So this is not a viable option.

Doug Miller

unread,
Jun 23, 2015, 4:19:10 PM6/23/15
to cefs...@googlegroups.com
I figured out what the problem is. It is not a build or dependency problem.

The problem is that I had instantiated an instance of ChromiumWebBrowser before calling Cef.Initiatlize().  I had not called Application.Run or displayed the Form yet.

This sequence does not cause a problem under CefSharp 37 - but it causes the errors I saw under CefSharp 39.

In the future I would suggest that Cef.Initialize throw a meaningful exception with a usable stack trace in this scenario (rather than just returning false).  I realize this suggestion is more appropriate for the CEF developers, rather than CefSharp.

Alex Maitland

unread,
Jun 23, 2015, 7:10:10 PM6/23/15
to cefs...@googlegroups.com
CefSharp is undergoing a major rewrite at the moment. Feel free to create a PR

https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Core/Cef.h#L149
Reply all
Reply to author
Forward
0 new messages