Usually this error indicates that the ASP.NET Core Module is not installed on the server. Hosting ASP.NET Core application on IIS requires Microsoft ASP.NET Core Module. You should confirm that the module has been installed. Reference
Installing IIS URL Rewrite (https://www.iis.net/downloads/microsoft/url-rewrite) helped me in this case.
Reinstall .NET core or do a repair. It worked for me. This happens when you first install .NET core before IIS.
Installing .NET Core hosting bundle with respect to my .NET Core release version worked for me.
For .NET Core 2.2 you can visit here
Or you can select other versions here
I was getting this error on Windows 10, and I had to install the Core Hosting Bundle.
Note to Microsoft: If I'm installing the SDK, maybe I need the hosting bundle too.
User contributions licensed under CC BY-SA 3.0