Click here to Skip to main content
15,885,155 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have no success with the CefSharp with windows forms. The project compiles. But the browser control never launches. The log includes the following two messages.

[1105/111450.741:ERROR:browser_gpu_channel_host_factory.cc(119)] Failed to launch GPU process.

[1105/111450.835:ERROR:gpu_process_transport_factory.cc(1027)] Lost UI shared context.

I can't find a sample project in its entirety. Where can I look or help? I'm using VS2017 community edition.

What I have tried:

I've tried to use older GitHub versions without success. And different builds for X86 and X64. They all have the same problem.
Posted
Updated 5-Nov-18 11:24am

1 solution

From what I recall, and this is from a few years back, I had to make sure my hosting app was x86. This was my initialization sequence:

Cef.EnableHighDPISupport();
CefSettings settings = new CefSettings();
settings.CachePath = "[somePath]\cache");
settings.RemoteDebuggingPort = 8088;  // If you want to enable remote debugging
Cef.Initialize(settings);
browser = new ChromiumWebBrowser("www.google.com");

and hooking up some events and registering a .NET object:
browser.FrameLoadEnd += OnPageLoaded;
browser.LoadError += OnLoadError;
browser.ConsoleMessage += OnConsoleMessage;

browser.RegisterJsObject("dotNet", scriptObject);

and don't forget before you exit:
Cef.Shutdown();


Hope that helps!
 
Share this answer
 
Comments
BobbyStrain 7-Nov-18 11:11am    
I solved the issue by downloading the project at GitHub. It didn't work "out of the box" either. But a simple fix resolved the issue. I was hoping that it could be used like Microsoft's browser control. Alas, not so. Maybe I will have to resort to Microsoft's control.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900