Aller au contenu

UseStartup used with WebApplicationBuilder.WebHost (ASP0010)

Ce contenu n’est pas encore disponible dans votre langue.

Key dotnet.api.usestartup-on-builder-webhost · Severity error · Category api

ASP.NET Core analyzer ASP0010. Flags UseStartup called on WebApplicationBuilder.WebHost, which throws at startup.

builder.WebHost.UseStartup<Startup>();
var startup = new Startup(builder.Configuration);
startup.ConfigureServices(builder.Services);
var app = builder.Build();
startup.Configure(app);