.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"/>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM