以我公司所在的测试服务器为例:windows server2012、IIS 7
部署 .NET8 程序不出意外会报这个错:
The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.
这是因为服务器没有安装Hosting Bundle
在安装完 Hosting Bundle 之后,可能还会报如下错误:
HTTP Error 500.30 - ASP.NET Core app failed to start
Common solutions to this issue:
•The app failed to start
•The app started but then stopped
•The app started but threw an exception during startup
Troubleshooting steps:
• Check the system event log for error messages
• Enable logging the application process' stdout messages
• Attach a debugger to the application process and inspect
这是因为 webconfig 文件没有配置正确,更改 <aspNetCore processPath="dotnet" arguments=".\YourAppName.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
中的 InProcess
改成 OutOfProcess
即可(高版本服务器可能不需要)。
即完整的内容为:
<aspNetCore processPath="dotnet" arguments=".\YourAppName.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="OutOfProcess" />
标签:process,IIS,部署,app,application,NET8,服务器
From: https://www.cnblogs.com/ms27946/p/18518856