CefSharp Example
Go to file
amaitland fcbdda0964 WinForms - Add some extra Dispose checks to InvokeOnUiThreadIfRequired
Also added stackoverflow link regarding calling after the control has been disposed
2019-12-14 11:56:47 +10:00
CefSharp.MinimalExample.OffScreen WinForms/WPF/OffScreenRemove CefSharpSettings.SubprocessExitIfParentProcessClosed = true; as it's now the default 2019-12-14 11:52:37 +10:00
CefSharp.MinimalExample.WinForms WinForms - Add some extra Dispose checks to InvokeOnUiThreadIfRequired 2019-12-14 11:56:47 +10:00
CefSharp.MinimalExample.Wpf WinForms/WPF/OffScreenRemove CefSharpSettings.SubprocessExitIfParentProcessClosed = true; as it's now the default 2019-12-14 11:52:37 +10:00
.gitattributes Added minimal example of how CefSharp can be used. Only WPF so far. 2013-11-12 13:14:11 +02:00
.gitignore Ignore .vs directory 2018-06-25 13:22:58 +10:00
CefSharp.MinimalExample.netcore.sln Add .NET Core 3.0 WinForms/WPF/OffScreen examples (#57) 2019-09-10 18:20:34 +10:00
CefSharp.MinimalExample.sln Add OffScreen example 2014-11-27 16:40:15 +10:00
LICENSE Updated name of copyright holder. 2013-11-11 09:28:32 +02:00
NuGet.config Add app.manifest to Offscreen example so GPU acceleration works on windows 10 2016-07-05 12:29:08 +10:00
README.md Add .NET Core 3.0 WinForms/WPF/OffScreen examples (#57) 2019-09-10 18:20:34 +10:00

CefSharp.MinimalExample

Minimal example of how the CefSharp library can be used using the official Nuget packages with .NET Framework projects (CefSharp.MinimalExample.sln) and .NET Core projects (CefSharp.MinimalExample.netcore.sln).

Includes examples for

  • WinForms
  • WPF
  • OffScreen

For a more complete example of each project see the main CefSharp repository.

.NET Core support

As of version 75.1.142, the CefSharp NuGet packages can be used with .NET Core 3.0 projects (as shown by the examples). However, the current versions have some limitations that you should be aware of:

  • The target machine still needs to have .NET Framework 4.5.2 or higher installed, as the CefSharp.BrowserSubprocess.exe is still used.
  • The project file needs to update the references of CefSharp.WinForms/CefSharp.WPF/CefSharp.OffScreen, as well as CefSharp.Core and CefSharp to use <Private>true</Private>, as otherwise the CoreCLR would not load these libraries as they would not be specified in the .deps.json file.
  • When publishing a self-contained app using a runtime identifier win-x64 or win-x86, you need to set the Platform property to x64 or x86; as otherwise it would be AnyCPU and the check in the .targets file of the NuGet package would fail.
    Example:
    • x86: dotnet publish -f netcoreapp3.0 -r win-x86 -p:Platform=x86
    • x64: dotnet publish -f netcoreapp3.0 -r win-x64 -p:Platform=x64

It is possible to publish the application as single EXE file by adding -p:PublishSingleFile=true.