Application is running inside IIS process but is not configured to use IIS server .NET Core 3.0

前端 未结 3 877
小蘑菇
小蘑菇 2021-02-01 12:22

I have migrated our application from .NET Core 2.2 to version 3.0. Actually I created the new application in 3.0 from scratch and then copied source code files. Everything looks

3条回答
  •  温柔的废话
    2021-02-01 13:03

    I also came across this issue while following the documentation https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.0&tabs=visual-studio

    For your case I have checked and the code below will work, with the call to webBuilder.UseKestrel() removed.

    public static IHostBuilder CreateHostBuilder(string[] args) =>
           Host.CreateDefaultBuilder(args)
               .ConfigureWebHostDefaults(webBuilder =>
               {
                   webBuilder.UseContentRoot(Directory.GetCurrentDirectory());
                   webBuilder.UseIISIntegration();
                   webBuilder.UseStartup();
               });
    

提交回复
热议问题