diff --git a/src/ElectronNET.Templates/templates/blazor/.template.config/template.json b/src/ElectronNET.Templates/templates/blazor/.template.config/template.json
index 8b5639f..0b5dd72 100644
--- a/src/ElectronNET.Templates/templates/blazor/.template.config/template.json
+++ b/src/ElectronNET.Templates/templates/blazor/.template.config/template.json
@@ -30,7 +30,7 @@
}
],
"replaces": "net8.0",
- "defaultValue": "net8.0"
+ "defaultValue": "net10.0"
},
"ElectronVersion": {
"type": "parameter",
diff --git a/src/ElectronNET.Templates/templates/blazor/Components/App.razor b/src/ElectronNET.Templates/templates/blazor/Components/App.razor
index 99acfbb..423b01a 100644
--- a/src/ElectronNET.Templates/templates/blazor/Components/App.razor
+++ b/src/ElectronNET.Templates/templates/blazor/Components/App.razor
@@ -5,7 +5,9 @@
+
+
ElectronBlazorApp
diff --git a/src/ElectronNET.Templates/templates/blazor/Program.cs b/src/ElectronNET.Templates/templates/blazor/Program.cs
index 3a94ddc..83fcba6 100644
--- a/src/ElectronNET.Templates/templates/blazor/Program.cs
+++ b/src/ElectronNET.Templates/templates/blazor/Program.cs
@@ -1,16 +1,30 @@
using ElectronNET.API;
using ElectronNET.API.Entities;
+using ElectronNET.AspNet.Middleware;
+using ElectronNET.AspNet.Services;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
+builder.Services.AddSingleton();
+
+builder.Services.AddElectron();
+
// Starts the Electron shell and invokes ElectronAppReady once it is up.
builder.UseElectron(args, ElectronAppReady);
var app = builder.Build();
+app.UseMiddleware();
+app.UseRouting();
+
+if (!app.Environment.IsDevelopment())
+{
+ app.UseExceptionHandler("/Error", createScopeForErrors: true);
+}
+
app.UseStaticFiles();
app.UseAntiforgery();
@@ -24,6 +38,7 @@ static async Task ElectronAppReady()
{
var window = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions
{
+ IsRunningBlazor = true,
Width = 1152,
Height = 940,
Show = false,