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

前端 未结 3 929
小蘑菇
小蘑菇 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:04

    I had the same error then to fix my problem I needed to change webBuilder.UseKestrel(); to ConfigureKestrel(serverOptions => {})

    My Program.cs before:

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

    My Program.cs fixed:

    public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder.ConfigureKestrel(serverOptions =>
                {
                })
                .UseStartup();
            });
    

提交回复
热议问题