小编İsa*_*NGİ的帖子

.NET 6.0 Cannot modify ServiceCollection after application is built problem

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();


app.UseRouting();
builder.Services.AddControllersWithViews();
app.UseEndpoints(endpoints => endpoints.MapControllerRoute(
        name: "default",
        pattern : "{Controller}/{Action}"
    ));
app.Run();

Run Code Online (Sandbox Code Playgroud)

When I Write This Code Into Program.cs I Get An Error Like Title

c# asp.net-core-mvc .net-6.0

5
推荐指数
2
解决办法
2万
查看次数

标签 统计

.net-6.0 ×1

asp.net-core-mvc ×1

c# ×1