C# – IIS: Handler “aspNetCore” has a bad module “AspNetCoreModuleV2” in its module list

.net coreasp.net-mvcciis

I used angular .net core 2.2 template to build an application. In localhost working fine, When I host to IIS I'm getting this error. I'm using IIS 10 to host the application.

Error,

HTTP Error 500.21 – Internal Server Error
Handler "aspNetCore" has a bad module "AspNetCoreModuleV2" in its module list

Best Answer

Windows IIS

Solution: Install the hosting bundle.

Reason: Although the SDK normally contains the runtime, however, it seems the SDK installer is not registering the runtime correctly on the server.

Workaround (not recommended):

Change AspNetCoreModuleV2 to AspNetCoreModule inside web.config.

Azure platform hosting

Install the .NET Core runtime extension by selecting Extensions and then installing .NET Core Runtime.