系統日志錯誤消息:
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"/>