ElectronSharp.API 36.2.0.59099

dotnet add package ElectronSharp.API --version 36.2.0.59099
                    
NuGet\Install-Package ElectronSharp.API -Version 36.2.0.59099
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ElectronSharp.API" Version="36.2.0.59099" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ElectronSharp.API" Version="36.2.0.59099" />
                    
Directory.Packages.props
<PackageReference Include="ElectronSharp.API" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ElectronSharp.API --version 36.2.0.59099
                    
#r "nuget: ElectronSharp.API, 36.2.0.59099"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ElectronSharp.API@36.2.0.59099
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ElectronSharp.API&version=36.2.0.59099
                    
Install as a Cake Addin
#tool nuget:?package=ElectronSharp.API&version=36.2.0.59099
                    
Install as a Cake Tool

<img src="https://github.com/theolivenbaum/electron-sharp/blob/main/assets/electron-sharp-logo.svg" width="100" height="100"/>

ElectronSharp

Build cross platform desktop apps with .NET 9 and ASP.NET Core (Razor Pages, MVC), Blazor or h5.

ElectronSharp is a wrapper around a "normal" Electron application with an embedded ASP.NET Core application. It uses a socket-based IPC bridge we can invoke Electron APIs from .NET.

The CLI extensions hosts the toolset to build and start ElectronSharp-based applications.

ElectronSharp is a hard fork from the original Electron.NET project, mantained by me and used to build the Curiosity app.

📦 NuGet:

  • API NuGet
  • CLI NuGet

🛠 Requirements to run:

The current ElectronSharp CLI builds Windows/macOS/Linux binaries. The API uses .NET 9, so our minimum base OS is the same as .NET 9.

Also you should have installed:

👩‍🏫 Usage

To activate and communicate with the Electron API, include the ElectronSharp.API NuGet package in your ASP.NET Core app. Check out the Electron.SampleApp for an example of how to use ElectronSharp.

PM> Install-Package ElectronSharp.API

Program.cs

You start ElectronSharp up with an UseElectron WebHostBuilder-Extension.

public static IHostBuilder CreateHostBuilder(string[] args) =>
    Host.CreateDefaultBuilder(args)
        .ConfigureWebHostDefaults(webBuilder =>
        {
            Electron.ReadAuth();
            webBuilder.UseElectron(args);
            webBuilder.UseStartup<Startup>();
        });

Startup.cs

Open the Electron Window in the Startup.cs file:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    ...

    // Open the Electron-Window here
    Task.Run(async () => await Electron.WindowManager.CreateWindowAsync());
}

Setup Using Minimal-API

Electron.ReadAuth();

var builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseElectron(args);
...
var browserWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions
{
    Width = 1152,
    Height = 940,
});
await app.RunAsync();

🚀 Start the Application

To start the application make sure you have installed the "ElectronSharp.CLI" packages as global tool:

dotnet tool install ElectronSharp.CLI -g

At the first time, you need an ElectronSharp project initialization. Type the following command in your app folder:

electron-sharp init
  • Now a electronnet.manifest.json should appear in your ASP.NET Core project
  • Now run the following:
electron-sharp start

Hint

If invoking any of those commands gives you strange errors (like .NET 5 not installed), it means you've typed electronize instead of electron-sharp.

Note

Only the first run is usually slow due to dependency downloads. The next will go on faster.

🔭 Develop ElectronSharp apps using a file watcher

You can use a file watcher mode to monitor your project folder for changes, and automatically restart the project:

electron-sharp start /watch

🐞 Debug

Start your ElectronSharp application with the ElectronSharp CLI command. In Visual Studio attach to your running application instance. Go in the Debug Menu and click on Attach to Process.... Sort by your projectname on the right and select it on the list.

📔 Usage of the Electron-API

A complete documentation will follow. Until then take a look in the source code of the sample application:
ElectronSharp Sample App

⛏ Build

Here you need the ElectronSharp CLI as well. Type the following command in your ASP.NET Core folder:

electron-sharp build /target win

There are additional platforms available:

electron-sharp build /target win
electron-sharp build /target osx
electron-sharp build /target osx-arm64
electron-sharp build /target linux

Those four "default" targets will produce packages for those platforms. Note that the osx-arm64 is for Apple Silicon Macs.

For certain NuGet packages or certain scenarios you may want to build a pure x86 application. To support those things you can define the desired .NET runtime, the electron platform and electron architecture like this:

electron-sharp build /target custom "win7-x86;win32" /electron-arch ia32 

The end result should be an electron app under your /bin/desktop folder.

Note

macOS builds can't be created on Windows machines because they require symlinks that aren't supported on Windows (per this Electron issue). macOS builds can be produced on either Linux or macOS machines.

Develop

Install dotnet tool locally

  • Build the CLI tool using dotnet build, this should create a nuget package in the artifact directory
  • Execute in the main electronnet solution folder
dotnet tool update --add-source ./artifacts/ -g electronsharp.cli -v d	

👨‍💻 Original (Electron.NET) Authors

  • Gregor Biswanger - (Microsoft MVP, Intel Black Belt and Intel Software Innovator) is a freelance lecturer, consultant, trainer, author and speaker. He is a consultant for large and medium-sized companies, organizations and agencies for software architecture, web- and cross-platform development. You can find Gregor often on the road attending or speaking at international conferences. - Cross-Platform-Blog - Twitter @BFreakout
  • Robert Muehsig - Software Developer - from Dresden, Germany, now living & working in Switzerland. Microsoft MVP & Web Geek. - codeinside Blog - Twitter @robert0muehsig

See also the list of contributors who participated in the original project.

🙋‍♀️🙋‍♂ Contributing

Feel free to submit a pull request if you find any bugs (to see a list of active issues, visit the Issues section. Please make sure all commits are properly documented.

🎉 License

MIT-licensed

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
36.2.0.59099 490 6/30/2025
36.2.0.57911 522 5/8/2025
35.1.4.57522 186 4/5/2025
35.1.2.57212 1,409 3/28/2025
35.0.2.56759 299 3/17/2025
34.0.1.55684 1,198 1/30/2025
34.0.1.55490 238 1/25/2025
33.3.1.54760 405 1/7/2025
33.2.0.53881 651 11/21/2024
33.2.0.53880 129 11/21/2024
32.0.1.51369 1,304 8/23/2024
31.3.1.50855 221 7/29/2024
31.3.0.50755 200 7/28/2024
31.3.0.50594 201 7/25/2024
31.2.1.50335 304 7/16/2024
31.2.0.50292 175 7/15/2024
31.1.0.50269 135 7/13/2024
31.1.0.49989 275 6/27/2024
30.0.6.49104 554 5/22/2024
30.0.6.49034 131 5/19/2024
30.0.6.48961 262 5/16/2024
30.0.4.48738 197 5/14/2024
30.0.2.48552 208 5/9/2024
30.0.2.48434 193 5/7/2024
30.0.2.48296 155 5/2/2024
30.0.1.47933 286 4/19/2024
30.0.0.47870 157 4/17/2024
29.3.0.47750 246 4/12/2024
29.1.5.47165 352 3/22/2024
29.1.5.47134 216 3/21/2024
29.1.4.46985 265 3/14/2024
29.0.1.46142 927 2/22/2024
28.2.0.44969 1,562 1/27/2024
28.1.3.44599 281 1/11/2024
28.0.0.44380 379 12/14/2023
27.1.0.43670 1,782 11/17/2023
27.1.0.43644 152 11/16/2023
27.1.0.43604 218 11/16/2023
27.0.4.43553 202 11/13/2023
27.0.4.43552 151 11/13/2023
27.0.4.43498 281 11/9/2023
27.0.2.43249 201 10/24/2023
27.0.1.43128 499 10/19/2023
27.0.0.43002 268 10/13/2023
26.3.0.42624 414 10/5/2023
26.3.0.42623 172 10/5/2023
26.2.4.42548 233 10/2/2023
26.2.2.42382 277 9/20/2023
26.2.1.42149 257 9/16/2023
26.2.1.42101 221 9/15/2023
26.2.0.41770 274 9/7/2023
26.1.0.41750 169 9/6/2023
26.1.0.41739 277 9/6/2023
26.1.0.41637 211 9/5/2023
26.1.0.41603 168 9/4/2023
26.1.0.41265 342 8/28/2023
26.1.0.41264 198 8/28/2023
26.1.0.41263 186 8/28/2023
26.1.0.41243 207 8/28/2023
26.1.0.41010 288 8/24/2023
26.0.0.40902 258 8/22/2023
25.3.1.40533 447 8/8/2023
25.3.1.40262 282 7/20/2023
25.3.0.40090 220 7/16/2023
25.2.0.39535 611 6/27/2023
25.2.0.39487 206 6/26/2023
25.0.1.39151 372 6/2/2023
25.0.0.39150 256 6/2/2023
25.0.0.38955 280 5/30/2023
24.4.0.38875 258 5/25/2023
24.4.0.38874 228 5/25/2023
24.0.0.37423 856 4/11/2023
23.1.3.36686 837 3/15/2023
23.1.3.36685 297 3/15/2023
23.1.3.36684 304 3/15/2023
23.1.3.36622 311 3/9/2023
23.0.0.36276 503 2/15/2023
23.0.0.36236 376 2/14/2023
23.0.0.36228 343 2/13/2023
23.0.0.36192 360 2/13/2023
23.0.0.35946 423 2/7/2023
22.2.0.35891 410 2/5/2023
22.2.0.35887 366 2/4/2023
22.1.0.35531 505 1/27/2023
22.0.2.35227 770 1/15/2023
22.0.0.35063 408 1/5/2023
22.0.0.35062 395 1/5/2023
22.0.0.35061 414 1/5/2023
22.0.0.35059 395 1/5/2023
22.0.0.35057 427 1/5/2023