Short instruction of how to implement ASP.NET Core MVC (.NET 8.0) with ElectronNET (23.6.1).
-
Create new project with
dotnet
tool:dotnet new mvc --use-program-main
-
Add package
ElectronNET.API
to project:dotnet add package ElectronNET.API
-
Add
electronize
todotnet
tools:dotnet tool install ElectronNET.CLI -g
-
Add following code to
Program.cs
:// Add using statements using ElectronNET.API; using ElectronNET.API.Entities; // ... // Add after var builder = WebApplication.CreateBuilder(args); builder.WebHost.UseElectron(args); builder.Services.AddElectron(); // ... // Add instead of app.Run(); // Remember to add async to Main method await app.StartAsync(); await Electron.WindowManager.CreateWindowAsync(); app.WaitForShutdown();
-
Electronize app:
electronize init
-
Start app (first time is slow beacause of
npm install
):electronize start
-
If you want to build with
electronize
, you will needelectron-builder
tool:npm install -g electron-builder
-
Now build app with command:
electronize build /target win-x64