On around 1 of 20 startups of the C# WPF application and opening a window with CefSharp Control on it, I get the exception:
Cef.IsInitialized was false!.Check the log file for errors!. See for details.
Stacktrace: CefSharp.Wpf.ChromiumWebBrowser.InitializeCefInternal() CefSharp.Wpf.ChromiumWebBrowser.NoInliningConstructor()
CefSharp.Wpf.ChromiumWebBrowser..ctor()
Logfile does not state any errors.
I use the following code at startup:
public static void InitCef() {
try {
var cefLogFileName = Logger.GetLogFileName() + ".cef";
var settings = new CefSettings() {
LogFile = cefLogFileName, //You can customise this path
LogSeverity = LogSeverity.Info // You can change the log level
};
//Perform dependency check to make sure all relevant resources are in our output directory.
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
} catch (Exception ex) {
_logger.LogError(MethodBase.GetCurrentMethod(), ex, () => "Startup abgebrochen.");
}
}
After this code was running successfull the user can open a Window with CefSharp on it. => The above exceptions occurs sometimes.
Workaround is: Restart of the application. After a restart - most of the times - it is working.
CefSharp Version in use: 130.1.90
Any hints?