-
-
Notifications
You must be signed in to change notification settings - Fork 740
Open
Labels
Description
My electron App is not running when I`m adding services in the Program file.
The program file looks like
using ElectronNET.API;
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseElectron(args);
builder.Services.AddElectron();
builder.Services.AddControllersWithViews();
builder.Services.AddTransient<SomeInterface, SomeClass>();
var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.MapControllerRoute(
name: "default",
pattern: "{controller}/{action=Index}/{id?}");
app.MapFallbackToFile("index.html");
await app.StartAsync();
await Electron.WindowManager.CreateWindowAsync();
app.WaitForShutdown();
But when I remove
builder.Services.AddTransient<SomeInterface, SomeClass>();
it runs perfectly.
Any ideas how to solve this?