Skip to content

Commit 9b318ab

Browse files
committed
Cef.Initialize - Add more detail to exception through
Hopefully this reduces the support requests
1 parent 6a25e21 commit 9b318ab

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
@@ -168,7 +168,11 @@ namespace CefSharp
168168
if (IsInitialized)
169169
{
170170
// NOTE: Can only initialize Cef once, to make this explicitly clear throw exception on subsiquent attempts
171-
throw gcnew Exception("Cef can only be initialized once. Use Cef.IsInitialized to guard against this exception.");
171+
throw gcnew Exception("CEF can only be initialized once per process. This is a limitation of the underlying " +
172+
"CEF/Chromium framework. You can change many (not all) settings at runtime through RequestContext.SetPreference. " +
173+
"See https://github.com/cefsharp/CefSharp/wiki/General-Usage#request-context-browser-isolation " +
174+
"Use Cef.IsInitialized to guard against this exception. If you are seeing this unexpectedly then you are likely " +
175+
"calling Cef.Initialize after you've created an instance of ChromiumWebBrowser, it must be before the first instance is created.");
172176
}
173177

174178
if (cefSettings->BrowserSubprocessPath == nullptr)

0 commit comments

Comments
 (0)