2025-10-14 06:24:10 +02:00
2024-05-01 09:49:47 +05:00
2024-04-25 00:58:50 +09:00
2017-10-17 23:24:03 +02:00
2025-10-14 03:48:53 +02:00
2025-10-13 13:03:36 +02:00
2023-04-03 07:47:34 +02:00
2023-04-03 07:47:34 +02:00
2025-10-14 03:48:03 +02:00
2024-02-15 01:12:33 +01:00
2025-10-13 13:03:53 +02:00
2025-10-14 06:24:10 +02:00
2025-10-14 06:24:10 +02:00

Electron.NET Logo

donate Gitter Build status

Electron.Net Core is here!

A Complete Transformation

ElectronNET.Core represents a fundamental modernization of Electron.NET, addressing years of accumulated pain points while preserving full API compatibility. This isn't just an update—it's a complete rethinking of how .NET developers build and debug cross-platform desktop applications with Electron.

Read more: What's New in ElectronNET.Core

Build cross platform desktop applications with .NET 6/8 - from console apps to ASP.Net Core (Razor Pages, MVC) to Blazor

Wait - how does that work exactly?

Well... there are lots of different approaches how to get a X-plat desktop app running. Electron.NET provides a range of ways to build .NET based solutions using Electron at the side of presentation. While the classic Electron.Net setup, using an ASP.Net host ran by the Electron side is still the primary way, there's more flexibility now: both, dotnet and Electron are now able to launch the other for better lifetime management, and when you don't need a local web server - like when running content from files or remote servers, you can drop the ASP.Net stack altogether and got with a lightweight console app instead.

📦 NuGet

NuGet ElectronNET.Core | NuGet ElectronNET.Core.API | NuGet ElectronNET.Core.AspNet

🛠 Requirements to Run

Our API uses .NET 6/8, so our

Also you should have installed:

👩‍🏫 Usage with ASP.Net

  • Create a new ASP.Net Core project
  • Install the following two nuget packages:
PM> Install-Package ElectronNET.Core

PM> Install-Package ElectronNET.Core.AspNet

Enable Electron.NET on Startup

To do so, use the UseElectron extension method on a WebApplicationBuilder, an IWebHostBuilder or any descendants.

Note

New in Electron.NET Core is that you provide a callback method as an argument to UseElectron(), which ensures that you get to know the right moment to set up your application UI.

Program.cs

using ElectronNET.API;
using ElectronNET.API.Entities;

    public static void Main(string[] args)
    {
        WebHost.CreateDefaultBuilder(args)
            .UseElectron(args, ElectronAppReady)
            .UseStartup<Startup>()
            .Build()
            .Run();
    }

   public static async Task ElectronAppReady()
    {
        var browserWindow = await Electron.WindowManager.CreateWindowAsync(
            new BrowserWindowOptions { Show = false });

        browserWindow.OnReadyToShow += () => browserWindow.Show();
    }

🚀 Starting and Debugging the Application

Just press F5 in Visual Studio or use dotnet for debugging.

📔 Usage of the Electron API

A complete documentation will follow. Until then take a look in the source code of the sample application:
Electron.NET API Demos

In this YouTube video, we show you how you can create a new project, use the Electron.NET API, debug a application and build an executable desktop app for Windows: Electron.NET - Getting Started

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.

👨‍💻 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
  • Dr. Florian Rappl - Software Developer - from Munich, Germany. Microsoft MVP & Web Geek. - The Art of Micro Frontends - Homepage - Twitter @florianrappl
  • softworkz - full range developer - likes to start where others gave up - MS MVP alumni and Munich citizen as well
  • 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 this 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.

🧪 Working with this Repo

This video provides an introduction to development for Electron.NET: Electron.NET - Contributing Getting Started

This repository consists of the main parts (API & CLI) and it's own "playground" ASP.NET Core application. Both main parts produce local NuGet packages, that are versioned with 99.0.0. The first thing you will need is to run one of the build scripts (.cmd or .ps1 for Windows, the .sh for macOS/Linux).

If you look for pure demo projects checkout the other repositories.

The problem working with this repository is, that NuGet has a pretty aggressive cache, see here for further information.

🙏 Donate

We do this open source work in our free time. If you'd like us to invest more time on it, please donate. Donation can be used to increase some issue priority. Thank you!

donate

Alternatively, consider using a GitHub sponsorship for the core maintainers:

Any support appreciated! 🍻

🎉 License

MIT-licensed. See LICENSE for details.

Enjoy!

Node.js Integration

Electron.NET requires Node.js integration to be enabled for IPC to function. If you are not using the IPC functionality you can disable Node.js integration like so:

WebPreferences wp = new WebPreferences();
wp.NodeIntegration = false;
BrowserWindowOptions browserWindowOptions = new BrowserWindowOptions
{
    WebPreferences = wp
};

Dependency Injection

ElectronNET.API can be added to your DI container within the Startup class. All of the modules available in Electron will be added as Singletons.

using ElectronNET.API;

public void ConfigureServices(IServiceCollection services)
{
    services.AddElectron();
}

💬 Community

Gitter

Besides the chat on Gitter and the issues discussed here you can also use StackOverflow with the tag electron.net.

If you want to sponsor the further maintenance and development of this project see the donate section.

Description
No description provided
Readme 9.9 MiB
Latest
2025-12-18 23:09:34 +00:00
Languages
C# 70.9%
HTML 10.7%
TypeScript 9.4%
JavaScript 6.5%
CSS 1.6%
Other 0.9%