ASP.NET 6 修改 WebRoot 路径
参考:https://www.cnblogs.com/chinasoft/p/16787959.html
注意内容:
--net 5 public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { //这里指定新位置 webBuilder.UseWebRoot("webroot") .UseStartup<Startup>(); }); ASP.NET 6 var builder = WebApplication.CreateBuilder(new WebApplicationOptions { Args = args, //这里指定新位置,也可以使用绝对路径 WebRootPath = "webroot" }); var app = builder.Build();