.netcore 部署IIS HTTP Error 500.30

系统日志错误消息:

Application '/LM/W3SVC/4/ROOT' with physical root 'D:\xxx\' hit unexpected managed exception, exception code = '0xe0434352'. Please check the stderr logs for more information.

将Program代码:

public static IHostBuilder CreateHostBuilder(string[] args) =>
    Host.CreateDefaultBuilder(args)
        .ConfigureWebHostDefaults(webBuilder =>
        {
            webBuilder.UseStartup<Startup>().UseUrls("http://*:8804");
        });

修改为:

public static IWebHostBuilder CreateHostBuilder(string[] args)
        {
            return WebHost.CreateDefaultBuilder(args).UseKestrel(opt =>
            {
                opt.Limits.MinResponseDataRate = null;
            }).UseIIS().UseStartup<Startup>();
        }

补充说明:(视情况而定,不一定需要修改)

1、同时在应用程序池中将启用32位应用程序设置为True

2、修改webconfig文件(必须为:hostingModel="inprocess"):

<aspNetCore processPath="dotnet" arguments=".\xxx.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess"/>

posted @ 2020-09-29 17:02  软件开发-汪七北  阅读(5599)  评论(0编辑  收藏  举报