Project Templates
Electron.NET ships a dotnet new template package so you can scaffold a ready-to-run desktop app instead of wiring up an ASP.NET project by hand.
🛠 System Requirements
See System Requirements.
📦 Install the Templates
dotnet new install ElectronNET.Core.Templates
To update to the latest version, run the same command again. To remove them:
dotnet new uninstall ElectronNET.Core.Templates
🚀 Available Templates
| Template | Short name | Description |
|---|---|---|
| Electron.NET Blazor App | electron-blazor |
A Blazor Server app hosted in an Electron shell |
🧱 Create a Blazor App
dotnet new electron-blazor -n MyDesktopApp
cd MyDesktopApp
Then start it in the Electron shell:
dotnet build
dotnet run
Options
| Option | Values | Default | Description |
|---|---|---|---|
-f, --framework |
net8.0, net10.0 |
net10.0 |
The target framework of the generated project |
-e, --electron-version |
any Electron version | 38.2.2 |
The Electron version the app is built against |
-p, --port |
port number | 8001 |
The port the ASP.NET server uses during development |
--no-restore |
— | — | Skip the automatic dotnet restore |
Example:
dotnet new electron-blazor -n MyDesktopApp -f net10.0 -e 30.4.0 -p 8123
📁 What You Get
MyDesktopApp/
├── Components/
│ ├── Layout/ MainLayout.razor, NavMenu.razor
│ ├── Pages/ Home.razor, Counter.razor
│ ├── App.razor
│ ├── Routes.razor
│ └── _Imports.razor
├── Properties/
│ ├── PublishProfiles/ win-x64, linux-x64 and osx-arm64 folder profiles
│ ├── electron-builder.json
│ └── launchSettings.json
├── wwwroot/app.css
├── appsettings.json
├── Program.cs
└── MyDesktopApp.csproj
The project already references ElectronNET.Core and ElectronNET.Core.AspNet, calls builder.UseElectron(...) in Program.cs, and passes all Migration Checks out of the box.
Note
ElectronNET.APIalso defines a type namedApp, which collides with the Blazor root component. That is why the template callsapp.MapRazorComponents<MyDesktopApp.Components.App>()with a fully qualified type name.
🚀 Next Steps
- Configuration - Adjust app metadata and Electron settings
- Debugging - Debug the .NET and Electron sides
- Package Building - Create distributable packages
- Configuration

- Startup-Methods

- Debugging

- Package Building

- Secure Communication

- Adding a
custom_main.js
- API Overview

- Electron.App

- Electron.Dialog

- Electron.Menu

- Electron.WindowManager

- Electron.Shell

- Electron.Screen

- Electron.Notification

- Electron.Tray

- Electron.Clipboard

- Electron.Dock

- Electron.HostHook

- Electron.IpcMain

- Electron.GlobalShortcut

- Electron.AutoUpdater

- Electron.NativeTheme

- Electron.PowerMonitor

custom_main.jsWant to contribute to this documentation? Please fork and create a PR! The Wiki is autogenerated from the /docs content in the repository.