Cefsharp upgradation

Having problems with building or using the CefSharp .NET binding? Ask your CEF-related questions here. Please ask general usage questions on StackOverflow.

Moderator: amaitland

Cefsharp upgradation

Postby a1dharm » Fri Dec 17, 2021 8:33 am

Hi All,

We have enterprises app and that app has been deployed thousands of customer site and uses millions of users. Since, the app currently running with cefsharp 71 version. And we want to upgrade cefsharp version with newer version. But we have some doubts which version we can choose. so that we can face minimal issue and will cover important cefsharp(chromium) fixed with cefsharp.
So, I just want to know your recommendation which cefsharp version we can choose for the upgradation.

Thanks in Advance

Regards
Dharmendra
a1dharm
Techie
 
Posts: 24
Joined: Fri Oct 22, 2021 2:08 am

Re: Cefsharp upgradation

Postby amaitland » Fri Dec 17, 2021 2:10 pm

Version 96 is the current supported version. This version includes critical chromium security updates.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: Cefsharp upgradation

Postby a1dharm » Sun Dec 19, 2021 10:10 am

OK But this one is latest and I think not received and observed user experiences from the market. So if we will choose it then it could be good options. or we can choose older than cefsharp 96 like 89 or 90. Then it can be right choice or not?
a1dharm
Techie
 
Posts: 24
Joined: Fri Oct 22, 2021 2:08 am

Re: Cefsharp upgradation

Postby amaitland » Sun Dec 19, 2021 2:09 pm

Version 96 is the current supported version.

Older versions no longer receive bug fixes.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: Cefsharp upgradation

Postby a1dharm » Wed Dec 22, 2021 5:53 am

Hi @amaitland

Ok, Now, team decided to applied cefsharp upgrading step by step( from 71 to 73 to 75 to 79 to 81....). so that we can identify cefsharp version wise changes and what will effect for our application.

As of now we have upgraded with 73 and 75 successfully there is no issue. but after upgraded with 79, Sometimes getting issue browser initialized issue i.e "The ChromiumWebBrowser instance creates the underlying Chromium Embedded Framework (CEF) browser instance in an async fashion." . That issue causing when show() the browser after the browser intialization. We have checked in cef 79, the only javascript object registration was changed for my project.

Earlier it was
CefSharpSettings.LegacyJavascriptBindingEnabled = true;
var jsWrapper = new JsWrapper(Wrapper.Instance, name);
browser.RegisterAsyncJsObject("metis", jsWrapper, new CefSharp.BindingOptions() { CamelCaseJavascriptNames = false });
browser.RegisterAsyncJsObject("TcFiles", Wrapper.MultipartFormUpload.Instance);

Now In Cefsharp 79

CefSharpSettings.LegacyJavascriptBindingEnabled = true;
var jsWrapper = new JsWrapper(Wrapper.Instance, name);
browser.JavascriptObjectRepository.Register("metis", jsWrapper, isAsync: true, options: new BindingOptions() { CamelCaseJavascriptNames = false });
browser.JavascriptObjectRepository.Register("TcFiles", Wrapper.MultipartFormUpload.Instance, isAsync: true);

Error

[34 2021-12-21 12:35:28.185] <E/Application> Exception:The ChromiumWebBrowser instance creates the underlying Chromium Embedded Framework (CEF) browser instance in an async fashion. The undelying CefBrowser instance is not yet initialized. Use the IsBrowserInitializedChanged event and check the IsBrowserInitialized property to determine when the browser has been initialized., stack: at CefSharp.Wpf.ChromiumWebBrowser.GetBrowser() in C:\projects\cefsharp\CefSharp.Wpf\ChromiumWebBrowser.cs:line 2764
at mobile.ChromiumWebBrowserCustom.DoSize(Size size) in C:\xxx\xxx\projects\win10\project\ChromiumWebBrowserCustom.cs:line 83
at mobile.ChromiumWebBrowserCustom.OnActualSizeChanged(Object sender, SizeChangedEventArgs e) in C:\xxx\xxx\projects\win10\project\ChromiumWebBrowserCustom.cs:line 68
at System.Windows.SizeChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.FrameworkElement.OnRenderSizeChanged(SizeChangedInfo sizeInfo)
at System.Windows.ContextLayoutManager.fireSizeChangedEvents()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.UIElement.UpdateLayout()
at System.Windows.Interop.HwndSource.SetLayoutSize()
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
at System.Windows.Window.SetRootVisual()
at System.Windows.Window.SetRootVisualAndUpdateSTC()
at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.CreateSourceWindowDuringShow()
at System.Windows.Window.SafeCreateWindowDuringShow()
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.Show()
at mobile.BrowserWindow.<>c__DisplayClass106_0.<ShowWindow>b__0() in C:\xxx\xxx\projects\win10\project\BrowserWindow.cs:line 976
at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
at System.Windows.Threading.Dispatcher.Invoke(Action callback)
at mobile.BrowserWindow.ShowWindow(Boolean activate) in C:\xxx\xxx\projects\win10\project\BrowserWindow.cs:line 974
at mobile.MainWindow.init(Dictionary`2 jsObjects, String request) in C:\xxx\xxx\projects\win10\project\MainWindow.cs:line 203
at mobile.Wrapper.initMainWindow(String request) in C:\xxx\xxx\projects\win10\project\Wrapper.cs:line 109
at mobile.Wrapper.init(String request) in C:\xxx\xxx\projects\win10\project\Wrapper.cs:line 89
at mobile.App.<>c__DisplayClass15_0.<Application_Startup>b__0() in C:\xxx\xxx\projects\win10\project\App.xaml.cs:line 484
at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
at System.Windows.Threading.Dispatcher.Invoke(Action callback)
a1dharm
Techie
 
Posts: 24
Joined: Fri Oct 22, 2021 2:08 am

Re: Cefsharp upgradation

Postby amaitland » Wed Dec 22, 2021 2:45 pm

CefSharp 79 is very old and unsupported. Version 96 is the current supported version.

Your mobile.ChromiumWebBrowserCustom.DoSize method would appear to be calling GetBrowser before the browser has been initlized. Check IsBrowserInitialized is true before calling GetBrowser.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: Cefsharp upgradation

Postby a1dharm » Fri Dec 24, 2021 12:13 am

Ok, Thanks for your help. and we are moving to upgrade build by build. as of now we have successfully converted our app to 84 version . But moving in to 85.3.130. We are getting a issue that "CamelCaseJavascriptNames "

our code in Cefsharp 84
CefSharpSettings.LegacyJavascriptBindingEnabled = true;
browser.JavascriptObjectRepository.Register("metis", jsWrapper, isAsync: true, options: new BindingOptions() { CamelCaseJavascriptNames = false });

Cefsharp 85 not accepting the "CamelCaseJavascriptNames " parameter. so how can i write above code ?
a1dharm
Techie
 
Posts: 24
Joined: Fri Oct 22, 2021 2:08 am

Re: Cefsharp upgradation

Postby amaitland » Wed Dec 29, 2021 6:22 pm

Javascript Binding Naming is now configurable, BindingOptions.CamelCaseJavascriptNames has been removed see #3141 (comment) for an updated usage example.


https://github.com/cefsharp/CefSharp/pu ... -664261216


The release notes contain a list of breaking changes see https://github.com/cefsharp/CefSharp/re ... /v85.3.130

Please make sure to read the release notes.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am


Return to CefSharp Forum

Who is online

Users browsing this forum: No registered users and 12 guests