ASP.NET CORE Hosting - Error Internal Server Error Handler "aspNetCore" has a bad module "AspNetCoreModule" in its module list

I was facing the same issue after following this blog on how to host an asp.net core app into IIS. Visual studio had added the following web.config in the published output folder.

enter image description here

Then I looked into my IIS module to check if the .NET core hosting bundle was installed properly and I saw this,

enter image description here

So I changed the module in web.config,

<handlers>
  <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>

and it worked without any issues after that.


I had the same error. The handler was AspNetCoreModule, code is %SystemRoot%\system32\inetsrv\aspnetcore.dll. Changing the handler to AspNetCoreModuleV2 with code %ProgramFiles%\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll solved the problem.

enter image description here

enter image description here

This link is also helpful. In case the link doesn't work:

This error can occur if the AspNetCoreModule is not installed properly in IIS on the computer that is running the Microsoft Dynamics NAV Web Server components. The AspNetCoreModule is installed with the Microsoft .NET Core Windows Server Hosting bundle. You can get this error if this has been not been fully installed or the installation has been damaged in some way.

To resolve this issue, open Programs and Features in Control Panel and check whether Microsoft .NET Core Windows Server Hosting is installed. Then, try one of the following:

  • If it is installed, repair it from Programs and Features, by selecting it, choosing Change, and then choosing Repair.

  • If it is not installed, download and install Microsoft .NET Core - Windows Server Hosting bundle.


I was having the same error, I enabled the logs in web.config file by settinig stdoutLogEnabled="true"

<aspNetCore processPath=".\site01.exe" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />

And I found that I am missing the correct version of Microsoft.AspNetCore.App

It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '2.1.12' was not found.
  - The following frameworks were found:
      3.1.2 at [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]

so i installed the ASP.NET Core 2.1 Runtime (v2.1.16) - Windows Hosting Bundle Installer from https://dotnet.microsoft.com/download/dotnet-core/2.1/runtime/?utm_source=getdotnetcore&utm_medium=referral

AND MY PROBLEM WAS SOLVED.