Page 1 of 1

CefSettings.SingleProcess = false and Visual Studio Debug

PostPosted: Thu Sep 01, 2016 3:27 am
by sjoerd222888
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.

Re: CefSettings.SingleProcess = false and Visual Studio Debu

PostPosted: Thu Sep 01, 2016 7:17 am
by fddima
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?

Re: CefSettings.SingleProcess = false and Visual Studio Debu

PostPosted: Mon Sep 05, 2016 3:00 am
by sjoerd222888
Here a screenshot of the two forms:
CefGlueVSStopIssue.png
Two forms after Visual Studio stop.
CefGlueVSStopIssue.png (94.76 KiB) Viewed 30722 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.

Re: CefSettings.SingleProcess = false and Visual Studio Debu

PostPosted: Wed Jan 04, 2017 9:07 pm
by wilson0x4d
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.

Re: CefSettings.SingleProcess = false and Visual Studio Debu

PostPosted: Thu Nov 16, 2017 11:29 am
by sjoerd222888
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?