How to embed chrome browser in .net application

Chrome browser can be embedded in native application taking a hybrid approach to development where application is partly developed in native technology and partly in web. This has several advantages:

  • Salvage the existing investment in HTML/Javascript projects.
  • The part of application written in web technology is platform independent. This is very important due to variety of devices that are prevalent today.
  • Overcome the limitation of web technology and leverage the full power of the hardware through native code.

We need to know about three projects:

Project Type Description
Chromium Web Browser Chromium is the open source browser project which is behind Google Chrome.
ChromiumEmbedded
(CEF)
Web Browser Control Based on Chromium project, an open source embed-able Web Browser Control is developed called ChromiumEmbedded. ChromiumEmbedded supports programming interface for C++.
Xilium.CefGlue .Net Wrapper Quite a few wrappers are available to make ChromiumEmbedded accessible in other languages. The most updated and active wrapper for .Net is Xilium.CefGlue.

Follow the below steps to embed Chromium Web Browser control in your .Net application.

  1. Download the source code for Xilium from here (Click on the Branches tab and download the Master branch).
  2. Check for the current ChromiumEmbedded (CEF) build supported by Xilium here. As of now, the ChromiumEmbedded supported build is CEF 3.1547.1448. Download the relevant pre build binaries from here.
  3. Unzip the two downloaded files. Copy all DLLs from the Release folder of ChromuimEmbedded and place it in Debug folder of CefGlue.Demo.WinForms project in Xilium source code.
  4. Copy the locales folder under Resources from ChromuimEmbedded and place it in the Debug folder of CefGlue.Demo.WinForms project in Xilium source code.
  5. Open the Xilium source code in Visual Studio using Xilium.CefGlue.sln. Set CefGlue.Demo.WinForms as the startup project.
  6. Build and run the solution and you will get the demo .Net application running with embedded chromium browser.

12 thoughts on “How to embed chrome browser in .net application

      • i made all changes, after that i try to open Xilium.CefGlue.sln, it gives error,
        — The Selected file is a solution file, but was created by a newer version of this application and cannot be opened.

        — The system cannot find the file specified.

        # I am using Visual Studio 2010…

  1. Ramesh :
    i made all changes, after that i try to open Xilium.CefGlue.sln, it gives error,
    – The Selected file is a solution file, but was created by a newer version of this application and cannot be opened.
    – The system cannot find the file specified.
    # I am using Visual Studio 2010,windows Xp

  2. An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

    //this error occurs while running the project

    • It means that you have got a mix of 32-bit and 64-bit dlls in your project. Make sure that you

      – download 32-bit builds and
      – in Visual Studio project properties on Build tab, ‘Platform Target’ is set as ‘x84’ for all projects.

  3. Got error
    CEF runtime version mismatch: loaded version API hash “7095515ba3de7e4469c9670fbab90db580be985f”, but supported “a2b8f80d59bea941f9bd88acdfec034672990eae”.
    i am using “cef_binary_3.1650.1503_windows32_2.7z” and “xilium-xilium.cefglue-5df3be4e1129”

  4. Can you please tell me how to make Xilium work with JAWS? My chrome browser is enbedded with xilium. However when I try to make it work with jaws it reads the page partially.
    I am using commandLine.AppendSwitch(@”force-renderer-accessibility”); in the method OnBeforeCommandLineProcessing()
    Is there any other way to do it?

Leave a Reply

Your email address will not be published. Required fields are marked *