Subscribe to our YouTube Channel for more Videos

Error – Handler “aspNetCore” has a bad module “AspNetCoreModuleV2” in its module list

This post will explain how to resolve the error “Handler “aspNetCore” has a bad module “AspNetCoreModuleV2” in its module list” when you deploy your ASP.NET application.

There are times when you might face the below error immediately after you deployed your ASP.NET Core application.

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

You might notice that the application might be working fine on the localhost or Development machine and the error would be seen only when hosting the application.

The reason for the error is that you are using a different .NET Core version than the one installed in the hosting machine.

For example , I started facing the error because the application that i was deploying was targetting .NET Core 3.1 and few modules was using .NET Core 2.2. The hosting machine has only .NET Core 2.1 installed. so, changing the target version and building them ob .NET Core 2.1 for all the modules sorted out this issue for me.

Senthil Kumar B
Senthil Kumar is a former Microsoft MVP (Most Valuable Professional). He is a Co-Author of the book "Windows 10 Development Recipes using JavaScript and CSS" for Apress Publication. He is a technical presenter, blogger, mentor and a Geek.  Senthil is a regular speaker is various local user groups. He has presented at conferences like Great Indian Developer Summit (GIDS) & Microsoft DevCamps. You can reach out to him via his Twitter handle @isenthil.