CEF runtime already initialized Exception

583 views
Skip to first unread message

Shitiz Gupta

unread,
Feb 13, 2014, 2:18:32 PM2/13/14
to cef...@googlegroups.com
Hi Guys,

I am integrating Cef within one of our applications.

Architecture of the application is such that it uses .NET->Powerbuilder communication.

So when I am debugging, .NET runs and launches Powerbuilder which in turn is used to Launch the actual application.
I am loading and initializing CefRuntime on the launch of application login screen(by calling .NET function from open event of main Powerbuilder app window) and shutting down CefRuntime on application exit(similarly by calling a function in .NET from close event of main Powerbuilder app window).

Everything works fine from within the application. The problem arises when I try to relogin into application without restarting Powerbuilder.
So these are my steps:-

1) Run .NET start up project which launches Powerbuilder
2) Run Powerbuilder and login to application(CefInitialization occurs)
3) Exit the application which takes control back to Powerbuilder(CefShutdown occurs)
4) Now without exiting Powerbuilder, Run it again(Error when again trying to InitializeCef)

The error I get is:-

System.InvalidOperationException was unhandled by user code
  HResult=-2146233079
  Message=CEF runtime already initialized.
  Source=Xilium.CefGlue

I read somewhere on the Cef forum that Initialize/Shutdown should only be done once for a process run.
Kindly throw some light on this.

Thanks,
Shitiz

Dmitry Azaraev

unread,
Feb 14, 2014, 3:22:58 AM2/14/14
to cef...@googlegroups.com
> I read somewhere on the Cef forum that Initialize/Shutdown should only be done once for a process run.
> Kindly throw some light on this.
There is absolutely correct. Initialization/Shutdown should be happens once.




--
You received this message because you are subscribed to the Google Groups "CefGlue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cefglue+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Best regards,
   Dmitry

Shitiz Gupta

unread,
Feb 27, 2014, 2:18:02 PM2/27/14
to cef...@googlegroups.com
Hi Guys,

We are using a separate exe for the render process.
But when we run the browser control in the actual build, the render process exe is launched in a console instead of being run as a background process.

The same thing does not happen when debugging from visual studio.

Has anybody encountered this and know the cause of it?

Regards
Shitiz

Dmitry Azaraev

unread,
Feb 27, 2014, 4:43:29 PM2/27/14
to cef...@googlegroups.com
Child (renderer) process having console application type?


--
You received this message because you are subscribed to the Google Groups "CefGlue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cefglue+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Best regards,
   Dmitry

Shitiz Gupta

unread,
Feb 28, 2014, 7:46:39 AM2/28/14
to cef...@googlegroups.com, dmitry....@gmail.com
Hi Dmitry,

Yes, the renderer process is of Console application type..

Thanks,
Shitiz

Dmitry Azaraev

unread,
Feb 28, 2014, 7:53:33 AM2/28/14
to cef...@googlegroups.com
So change type to windowed. :)

Shitiz Gupta

unread,
Feb 28, 2014, 8:51:53 AM2/28/14
to cef...@googlegroups.com, dmitry....@gmail.com
Thanks mate:)

Shitiz Gupta

unread,
Apr 2, 2014, 2:48:31 AM4/2/14
to cef...@googlegroups.com
Hi Guys,

We are almost done with the integration of CefGlue within our application.
One problem we are facing is with the uninstall of our application.

When we uninstall our application, the Xilium.CefGlue dll remains in the installation folder and has to be removed manually for uninstall to complete.

Any suggestions?

Thanks,
Shitiz

On Friday, February 14, 2014 12:48:32 AM UTC+5:30, Shitiz Gupta wrote:

Dmitry Azaraev

unread,
Apr 2, 2014, 6:15:05 AM4/2/14
to cef...@googlegroups.com
Hi.

Nothing special with CEF/CefGlue - there is just installer's problem. Probably some process have library opened?


--
You received this message because you are subscribed to the Google Groups "CefGlue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cefglue+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Best regards,
   Dmitry

Shitiz Gupta

unread,
Apr 7, 2014, 7:19:44 AM4/7/14
to cef...@googlegroups.com
Hi,

I have checked and no process is using the dll.
And only the Xilium.CefGlue dll remains after uninstall and rest of the Cef files are removed.

Shitiz

On Friday, February 14, 2014 12:48:32 AM UTC+5:30, Shitiz Gupta wrote:

Dmitry Azaraev

unread,
Apr 7, 2014, 11:24:23 AM4/7/14
to cef...@googlegroups.com
Hi.
I never have this kind problem. There is should be exactly installer problem.


--
You received this message because you are subscribed to the Google Groups "CefGlue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cefglue+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Best regards,
   Dmitry

Pavel Dimitrov

unread,
Dec 11, 2015, 10:29:31 AM12/11/15
to CefGlue
Hello Guys,

I'm integrating Cef into a Revit addin that we are developing and we are having the same problem - everything works and when we close the Revit Addin and try to start it again we get the exact same exception:

System.InvalidOperationException: CEF runtime already initialized.
in Xilium.CefGlue.CefRuntime.Initialize(CefMainArgs args, CefSettings settings, CefApp application, IntPtr windowsSandboxInfo)
in Xilium.CefGlue.CefRuntime.Initialize(CefMainArgs args, CefSettings settings, CefApp Application)
...

We are only initializing and shutting it down once. The problem is only fixed when we exit Revit and start it again, then we can start the plugin again (once unless we close revit again).

How exactly did you fix this problem for you?

Perhaps, is there a way to check if it has already been initialized (in the case that we are starting the plugin again, before closing Revit) like with a try/catch block or something and if it has been, not to initialize it? ..

Best regards,
Pavel

Dmitry Azaraev

unread,
Dec 12, 2015, 4:18:06 AM12/12/15
to CefGlue

Hello.

You should initialize / shutdown CEF once in process. I.e. not per browser or per plugin. I'm did not know anything about Revit, so no have anything to say.


--
Reply all
Reply to author
Forward
0 new messages