I'm trying to host a Web application built on top of ASP.NET Core to IIS on a Windows 10 machine. I received the following error when I tried to navigate to the default landing page of the application:
HTTP Error 500.31 - Failed to load ASP.NET Core runtime
"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
To resolve this issue, I applied the following steps:
- I checked if the application pool has the right permissions to access the physical folder where the application is published
- I made sure the managed pipeline mode of the application pool is integrated as per the following screenshot:
- I checked the version of the hosting bundle, the version of the Windows Server Hosting and the Runtime should match:
- Microsoft .NET 5.0.11 - Windows Server Hosting
- Microsoft .NET SDK 5.*.*
- Microsoft .NET Runtime - 5.0.11
In order to check these versions, you can run the following command in the command prompt: run -> cmd -> dotnet --info
Running this command will display the version of the installed runtimes:
Read also: Top ASP.NET MVC Interview Questions for a Senior Position - Part 1
Tags:
ASP.NET