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

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

If you are having trouble deploying .NET Core applications to IIS on a Windows 10 machine as shown below.

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

HTTP Error 500.31 typically indicates an issue with the ASP.NET Core runtime configuration on your web server.

Here are some steps you can take to troubleshoot and potentially fix this error:

Check ASP.NET Core Runtime Installation

Ensure that the ASP.NET Core runtime is installed on the server. If you already have ASP.NET Core installed, make sure it's updated to the latest version.

Ensure that the application pool for your ASP.NET Core application is configured to use the correct .NET Core CLR version.

Make sure the .NET Core Hosting Bundle is correctly installed. This bundle includes the .NET Core runtime, ASP.NET Core runtime, and the IIS Module for hosting ASP.NET Core applications.

Check Permissions

Ensure that the application pool identity has the necessary permissions to access your application's files and resources.

Usually the problem will be resolved after installing the Hosting Bundle and don't forget to restart the Internet Information Services (IIS) server. You can easily download the hosting bundle for any version of .NET at here.