.NET8站点报错:HTTP Error 500.31 - Failed to load ASP.NET Core runtime
2024-03-11 3401 0
在IIS部署.NET8网站时报错:HTTP Error 500.31 - Failed to load ASP.NET Core runtime。服务器上已经安装了.NET8 X64运行时,如何解决?
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 information visit: https://go.microsoft.com/fwlink/?LinkID=2028526

解决方法:
如果是在IIS里发布网站的话,不是下载runtime运行时,而是下载Hosting Bundle。可以从微软官网下载.NET8的Hosting Bundle,下载安装后网站就可以正常访问了。

其他版本的ASP.NET Core在IIS里部署也是一样的做法,下载安装Hosting Bundle就可以了。