HTTP Error 500.31 - Failed to load ASP.NET Core runtime报错

在IIS部署.NET8站点时候,出现如下错误:

HTTP Error 500.31 - Failed to load ASP.NET Core runtime

Common solutions to this issue:

The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.

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

For more guidance on diagnosing and handling these errors, visit Troubleshoot ASP.NET Core on Azure App Service and IIS.

HTTP Error 500.31 - Failed to load ASP.NET Core runtime报错

可能是文件发布选项里勾选了 生成单个文件 引起的。IIS不支持单个文件的方式发布。

评论