-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CefBrowserHost::CreateBrowser call failed when trying to reuse BrowserSettings instance #2643
Comments
Can you please fork https://github.com/cefsharp/CefSharp.MinimalExample and provide an example that reproduce your problem. Using the Without an example that actually reproduces your problem there is anything I can do. |
@PitySOFT Are you able to provide an example that reproduces your problem? I'll be releasing |
Hi, didn't had time to make the example. I will come back with it when I'm ready to reproduce. Please release the 17.0.1 don't wait for me. Thanks. |
Hi, I manage to reproduce the crash in a minimal project. You have the project here. Binary file removed With Cef 69.0.0 will work fine, but using 71.0.0 will crash. |
No binary files, fork the minimal project instead and provide that as a link |
Yes, thank you. The issue is you're reusing the browser settings, the settings are disposed of after the browser is created at: CefSharp/CefSharp.WinForms/ChromiumWebBrowser.cs Lines 649 to 653 in 6f6ca94
This was added in 4a41fdf for WinForms |
Reusing browser settings is problematic, so making them single use only. Need an additional check and throw exception if they're disposed, will add that shortly.. Thanks for taking the time to reproduce 👍 |
The OffScreen version already checks this[1], seems the check is missing for WPF and WinForms 1: CefSharp/CefSharp.OffScreen/ChromiumWebBrowser.cs Lines 382 to 385 in 6f6ca94
|
Now that browser creation is common between WPF, informs and OffScreen checks can be made in
In WinForms it might make sense to remove the setter for browser settings. Will provide full analysis for discussion when I am in front of a computer |
Thanks for information, I confirm that not using the same BrowserSettings works. For the same example code I have some issues with onscreen keyboard for touch screens. I know that it's hard to test because the lack of the touch screens but maybe you can check something in the code. On CefSharp 65.0.1 the keyboard works perfect, but:
I can provide videos for all situations. |
Any problems with the onscreen keyboard would need to be fixed in CEF/Chromium, see https://github.com/cefsharp/CefSharp/blob/master/CONTRIBUTING.md#cefsharp-vs-chromium-embedded-frameworkcef |
Firstly it's possible to reuse a Every so often I would see users attempting to reuse a
My initial reaction was to simply things and just have a one to one mapping of How important is it to reuse a |
Having through about it I'm think of removing the restrictions and remove the code to |
Ended up going with what I think should be a happy medium. If Changes were made to |
@amaitland Any reason it wasn't implemented in the underlying |
…BrowserAdapter::CreateBrowser - Improve BrowserSettings disposed check message Follow up to #2643
@merceyz Excellent suggestion 👍 Follow up commit d2d1e6f Error message improved slightly. |
Excellent, however I was thinking it would be better to move all of it into that method. So that the same logic isn't repeated over all implementations |
What logic are you referring to? |
CefSharp/CefSharp.OffScreen/ChromiumWebBrowser.cs Lines 401 to 404 in 86b2d8c
This could be handled in the |
Yes it could. That wasn't the plan though. that would be a breaking change forcing users to always create Code like https://github.com/cefsharp/CefSharp/blob/cefsharp/67/CefSharp.Wpf.Example/Views/BrowserTabView.xaml.cs#L28 would all of a sudden be a |
What version of the product are you using?
What architecture x86 or x64?
On what operating system?
Are you using
WinForms
,WPF
orOffScreen
?What steps will reproduce the problem?
I have two instances of CefSharp with different CefSettings, because I can't change the settings on runtime. Depending on some data I choose what instance to show. Till version 71.0 the code where si make the swap between those two instances works great. But with version 71.0 it breaks with the exception attached below.
I try to set the Child of a WindowsFormsHost with an instance of a ChromiumWebBrowser with the following code MyFormsHost.Child = my ChromiumWebBrowser;
What is the expected output? What do you see instead?
Please provide any additional information below.
System.InvalidOperationException
HResult=0x80131509
Message=CefBrowserHost::CreateBrowser call failed, review the CEF log file for more details.
Source=CefSharp.Core
StackTrace:
at CefSharp.ManagedCefBrowserAdapter.CreateBrowser(IWindowInfo windowInfo, BrowserSettings browserSettings, RequestContext requestContext, String address) in c:\projects\cefsharp\cefsharp.core\managedcefbrowseradapter.cpp:line 29
The debug.log file is empty
Does this problem also occur in the
CEF
Sample Application from.The text was updated successfully, but these errors were encountered: