CefSettings.SingleProcess = false and Visual Studio Debug

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

CefSettings.SingleProcess = false and Visual Studio Debug

Postby sjoerd222888 » Thu Sep 01, 2016 3:27 am

When I have
Code: Select all
CefSettings.SingleProcess = false
and run the application in Debug mode and press Stop in Visual Studio the process is not really stopped.
Sometimes a popup appears: "The application has stopped working". Most of the times there are just two forms with no content staying open and two process can be seen in the Windows Task Manager.

I see nothing interesting in the log file.

Something with cleanup is not done well. If you stop with Visual Studio "Stop" then I have no way to call:
Code: Select all
CefRuntime.Shutdown()
Is this a potential issue?

I see that in the Sample CefGlue.Demo.WinForms the first thing with the "The application has stopped working" does also happen. Maybe this happens if the page is still loading. Is there a way around this?

But when waiting long enough and pressing stop in Visual Studio it stops and no process keeps running and no empty forms appear. Unfortunately I could not find yet what is the significant difference to my implementation. I would be happy for some ideas on what I should look for.
sjoerd222888
Techie
 
Posts: 15
Joined: Thu Jun 04, 2015 9:02 am

Re: CefSettings.SingleProcess = false and Visual Studio Debu

Postby fddima » Thu Sep 01, 2016 7:17 am

What you mean by two forms?

In case of "Stop" in debugger - of course something going wrong, but as for me - should not.

Does crash form happens from renderer process?
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: CefSettings.SingleProcess = false and Visual Studio Debu

Postby sjoerd222888 » Mon Sep 05, 2016 3:00 am

Here a screenshot of the two forms:
CefGlueVSStopIssue.png
Two forms after Visual Studio stop.
CefGlueVSStopIssue.png (94.76 KiB) Viewed 30535 times


It happens most of the time, but to my big surprise I could not reproduce this on Friday. But on Monday the issue is back again from weekend.

The issue with the crash is difficult to reproduce, you need good timing and click "Stop" at the right time. And I have no clue if it comes from the render process or not, there is no exception, no stacktrace, and no log information. It just stops.
sjoerd222888
Techie
 
Posts: 15
Joined: Thu Jun 04, 2015 9:02 am

Re: CefSettings.SingleProcess = false and Visual Studio Debu

Postby wilson0x4d » Wed Jan 04, 2017 9:07 pm

you may try checking to see if "visual studio hosting process" is enabled within the "debug" tab of the project options.

when this is enabled a "hosting process" is pre-loaded, even when you're not debugging, and is used as a loader (of sorts) for app debugging purposes.

disabling this may cause some binaries to become locked during or after debug sessions, this is a rare event. if it occurs you simply need to restart visual studio.

hope that solves the problem for you.
wilson0x4d
Newbie
 
Posts: 2
Joined: Wed Jan 04, 2017 3:19 pm

Re: CefSettings.SingleProcess = false and Visual Studio Debu

Postby sjoerd222888 » Thu Nov 16, 2017 11:29 am

Somehow I got around this, I cannot remember how. Now after upgrading to CefGlue version 58 the issue reappeared. Not for all implementation, just for one of my applications build with cef.
I have Visual Studio Hosting process disabled.

I have no idea how this can happen.

The structure of my core library for all CefGlue applications is sort of:

Code: Select all

// ...
CefRuntime.Load();
var settings = new CefSettings();
settings.SingleProcess = false;
settings.MultiThreadedMessageLoop = true;

var mainArgs = new CefMainArgs(argv);
var app = new MyCefApp();
           
var exitCode = CefRuntime.ExecuteProcess(mainArgs, app, IntPtr.Zero);
Console.WriteLine("CefRuntime.ExecuteProcess() returns {0}", exitCode);
if (exitCode != -1)
    return exitCode;

CefRuntime.Initialize(mainArgs, settings, app, IntPtr.Zero);

MyCefForm form = new MyCefForm();

Application.Run(form);
CefRuntime.Shutdown();


That's roughly the structure. Do you see something that could be wrong?
sjoerd222888
Techie
 
Posts: 15
Joined: Thu Jun 04, 2015 9:02 am


Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 18 guests