Skip to content

Commit 279413f

Browse files
committed
Cef.Initialize - Add more detail to exception through
Hopefully this reduces the support requests
1 parent fe26853 commit 279413f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CefSharp.Core/Cef.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ namespace CefSharp
155155
if (IsInitialized)
156156
{
157157
// NOTE: Can only initialize Cef once, to make this explicitly clear throw exception on subsiquent attempts
158-
throw gcnew Exception("Cef can only be initialized once. Use Cef.IsInitialized to guard against this exception.");
158+
throw gcnew Exception("CEF can only be initialized once per process. This is a limitation of the underlying " +
159+
"CEF/Chromium framework. You can change many (not all) settings at runtime through RequestContext.SetPreference. " +
160+
"See https://github.com/cefsharp/CefSharp/wiki/General-Usage#request-context-browser-isolation " +
161+
"Use Cef.IsInitialized to guard against this exception. If you are seeing this unexpectedly then you are likely " +
162+
"calling Cef.Initialize after you've created an instance of ChromiumWebBrowser, it must be before the first instance is created.");
159163
}
160164

161165
if (cefSettings->BrowserSubprocessPath == nullptr)

0 commit comments

Comments
 (0)