I had this same concern when trying to access a newly deployed web application on a Windows server.
It was throwing the error below:
Here's how I solved it:
First, I installed the latest version of .Net Core SDK using this link: https://dotnet.microsoft.com/download/dotnet/3.1. As of this writing, the latest version is 3.1.14
using the Windows x64 installer (since my Windows server is x64), which includes:
• .NET Core SDK 3.1.408
• .NET Core Runtime 3.1.14
• ASP.NET Core Runtime 3.1.14
• .NET Core Windows Desktop Runtime 3.1.14
Next, I installed the .NET Core Hosting bundle using this link https://dotnet.microsoft.com/permalink/dotnetcore-current-windows-runtime-bundle-installer which is an installer for the:
• .NET Core Runtime
• ASP.NET Core Module
The bundle allows ASP.NET Core apps to run with IIS.
Here's a screenshot of the webpage where you can download the .Net Core SDK and the .NET Core Hosting bundle
Here's a screenshot of the downloaded .Net Core SDK and the .NET Core Hosting bundle files with their actual file names in the Downloads directory of a Windows PC.
After the Hosting Bundle is installed, a manual IIS restart may be required. For example, the dotnet CLI tooling (command) might not exist on the PATH for running IIS worker processes.
To manually stop and start IIS, execute the following commands in an elevated command shell (Run as administrator):
net stop was /y
net start w3svc
This time when I tried accessing the web app, it worked just fine.
Resources:
The .NET Core Hosting Bundle
That's all.
I hope this helps