So, sometimes when you are trying to run you Asp.net core application you may get a screen like you can see in the screenshot below.
When you run your project you face this error "HTTP Error 500.31 Failed to load ASP NET Core runtime"
First, check your dot net core framework, to check your framework right click on the solution then click on properties new window will open then check your target framework . Now whatever target framework this project have must be installed in your system. Then it will be able to run properly.
Search "download dot net framework according to your target framework '3.1' " OR open the URL https://dotnet.microsoft.com/en-us/download/dotnet/3.1 click on the windows -> hosting bundle then automatically download is a start . You have to select correct version by checking the target framework version following the previous step.
go to the download folder double click on the setup, and install the package .
when installation is successfully completed . You can close the popup .
After installing the hosting bundle you run your project , then your project run successfully , see the image below
So , you can see you issue will be resolved . This is how you can fix error HTTP Error 500.31 Failed to load ASP NET Core runtime in you Asp.Net core web application.