Skip to content

Templates

github-actions[bot] edited this page Sep 7, 2026 · 1 revision

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.API also defines a type named App, which collides with the Blazor root component. That is why the template calls app.MapRazorComponents<MyDesktopApp.Components.App>() with a fully qualified type name.

🚀 Next Steps

Clone this wiki locally