Skip to content

Upgrading from CefSharp 1

Alex Maitland edited this page Jun 15, 2015 · 4 revisions

Things to note when Upgrading from CefSharp 1

Switch CefSharp Version

  • Remove CefSharp1 References (CefSharp, CefSharp.WinForms)
  • Delete all libs / locales of CefSharp1
  • Close Visual Studio completely and then reopen
  • Install CefSharp3 through Nuget (I just installed CefSharp.WinForms - it installs all required libraries as well)
  • Close Visual Studio completely and then reopen
  • Specify platform (x86 / x64)

Change class names

  • Renamed WebView to ChromiumWebBrowser
  • Renamed LoadCompleted to FrameLoadEnd
  • Renamed CEF to Cef
  • Renamed CefSharp.Settings to CefSettings
  • Change BrowserSettings initialization
webView = new WebView(url, browserSettings);
to this 
webView = new ChromiumWebBrowser(url); 
webView.BrowserSettings = browserSettings;
  • Rename ExecuteScript to ExecuteScriptAsync
  • No more webView.PropertyChanged (Use individual events in WinForms or DataBinding in WPF)
  • Change RequestHandler:
    1. remove RequestHandle and DownloadHandler class implementations
    2. add DownloadHandler
    3. change
    webView.RequestHandler = new RequestHandler();
    to
    webView.DownloadHandler = new DownloadHandler();
  • ILifeSpanHandler.OnBeforePopup has different parameters
    • so Implement Interface of ILifeSpanHandler and remove the old function signature

Your problem not listed here? Check out https://github.com/cefsharp/CefSharp/issues?q=is%3Aissue+label%3Acef1-cef3-upgrade or try searching on the CefSharp Google Group