-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Quick Start
To get started with CefSharp
checkout the CefSharp.MinimalExample project here on GitHub
. The project contains basic working examples of the WinForms, WPF and OffScreen versions.
- The General Usage Guide has details on many of the features currently available. If you're curious about how to do something, check here first.
- Need to Know/Limitations has a list of important information
- Output files description table (Redistribution) - List of files to be included in your app
- Frequently Asked Questions - Common issues such as JS integration, errors, etc
- Trouble Shooting - Common issues such as freezing, graphics/rendering issues, etc
- Install one of the following via the
Nuget Package Manager
from withinVisual Studio
- Review the Post Installation steps in the
Readme.txt
file that's opened inVisual Studio
upon installation. - Review the Release Notes for the version you just installed, a list of
Known Issues
for the problems we're currently aware of. - Check out the API Doc, it's version specific, make sure you pick the correct version.
- Add a new instance of the browser
- For WPF use CefSharp.Wpf.ChromiumWebBrowser
<!-- Add a xmlns:wpf="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf" attribute to your parent control --> <!-- Create a new instance in code or in `xaml` --> <Border Grid.Row="1" BorderBrush="Gray" BorderThickness="0,1"> <wpf:ChromiumWebBrowser x:Name="Browser" Address="www.google.com"/> </Border>
- For WinForms use CefSharp.WinFrorms.ChromiumWebBrowser
using CefSharp.WinForms; //Create a new instance in code or add via the designer //Set the ChromiumWebBrowser.Address property if to your Url if you use the designer. var browser = new ChromiumWebBrowser("www.google.com"); parent.Controls.Add(browser);
- For OffScreen use CefSharp.OffScreen.ChromiumWebBrowser
using CefSharp.OffScreen; //Create a new instance in code var browser = new ChromiumWebBrowser("www.google.com");
- For WPF use CefSharp.Wpf.ChromiumWebBrowser
TODO: Improve formatting, anyone with a GitHub
account can help improve this wiki. Please help out!
For details on using CefSharp
and targeting AnyCPU
please see https://github.com/cefsharp/CefSharp/issues/1714
The following three MinimalExample
branches demo the different options
- https://github.com/cefsharp/CefSharp.MinimalExample/tree/demo/anycpu
- https://github.com/cefsharp/CefSharp.MinimalExample/tree/demo/anycpuprefer32bit
- https://github.com/cefsharp/CefSharp.MinimalExample/tree/demo/anycpucopyfiles
For x86
or x64
set your Platform architecture to x86
or x64
see https://docs.microsoft.com/en-gb/visualstudio/ide/how-to-configure-projects-to-target-platforms?view=vs-2017 for details. The Platform
is defined in your projects solution and is changed using the Build -> Configuration Manager
in Visual Studio
. If you change the Platform Target property in your project the PlatformCheck
defined in CefSharp.Common.targets
will display an error on building your project.
change your Platform to x86 or x64 and the relevant files will be copied automatically. For details on changing your Platform see https://docs.microsoft.com/en-gb/visualstudio/ide/how-to-configure-projects-to-target-platforms?view=vs-2017
The following articles are unfortunately outdated, if you have written a new up to date article please include a link to it here.
-
How to use CefSharp in a Winforms application - Note that
AnyCPU
is now supported see https://github.com/cefsharp/CefSharp/issues/1714 - Embedded UI Guide
- If You Like It, Put a HTML5 UI on It
- Quick Start Guide (This guide is outdated, if someone has a newer one please add a link).