Giter Club home page Giter Club logo

cefsharp.minimalexample's Introduction

CefSharp.MinimalExample

Minimal example of how the CefSharp library can be used using the official Nuget packages

  • .NET Framework solution (CefSharp.MinimalExample.sln)
  • .NET Core solution (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.x projects (as shown by the examples). However, the current versions have some limitations that you should be aware of:

  • Chromium multi-process architecure launches multiple BrowserSubProcess instances for rendering, gpu acceleration, networking, plugins, etc.
  • Additional entires to your csproj/vbproj are required for the CoreCLR to load the CefSharp.* libraries (They would not be specified in the .deps.json file otherwise). See example below, the netcore.csproj files contained in this example provide a working demo.
  • 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.

.Net Core csproj/vbproj WPF

<!-- Add the following to your csproj/vbproj file -->
<ItemGroup>
	<Reference Update="CefSharp">
	  <Private>true</Private>
	</Reference>
	<Reference Update="CefSharp.Core">
	  <Private>true</Private>
	</Reference>
	<Reference Update="CefSharp.Wpf">
	  <Private>true</Private>
	</Reference>
</ItemGroup>

.Net Core csproj/vbproj WinForms

<!-- Add the following to your csproj/vbproj file -->
<ItemGroup>
    <Reference Update="CefSharp">
      <Private>true</Private>
    </Reference>
    <Reference Update="CefSharp.Core">
      <Private>true</Private>
    </Reference>
    <Reference Update="CefSharp.WinForms">
      <Private>true</Private>
    </Reference>
</ItemGroup>

.Net Core csproj/vbproj OffScreen

<!-- Add the following to your csproj/vbproj file -->
<ItemGroup>
    <Reference Update="CefSharp">
      <Private>true</Private>
    </Reference>
    <Reference Update="CefSharp.Core">
      <Private>true</Private>
    </Reference>
    <Reference Update="CefSharp.OffScreen">
      <Private>true</Private>
    </Reference>
</ItemGroup>

cefsharp.minimalexample's People

Contributors

aaronls avatar amaitland avatar angshuman-agarwal avatar evanwon avatar jornh avatar kpreisser avatar nikhilagrawaldotnet avatar perlun avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.