Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS: Handler "aspNetCore" has a bad module "AspNetCoreModuleV2" in its module list

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

like image 829
Arun kumar Avatar asked Dec 19 '18 07:12

Arun kumar


3 Answers

Install .Net Core 2.2 run-time bundle on hosting machine.

Or

Publish your project as self-contained.

like image 27
RavinderReddy Seelam Avatar answered Nov 08 '22 09:11

RavinderReddy Seelam


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.

like image 160
Shadi Namrouti Avatar answered Nov 08 '22 11:11

Shadi Namrouti


By removing V2 from modules="AspNetCoreModuleV2" worked for me. Note that my issue was related to running a .net core web api from visual studio. IE Express failed with a code 500 and upon investigating the error log describing "Handler 'aspNetCore' has a bad module.." was resolved by replacing with the below.

<handlers>
  <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
like image 30
Zack Evans Avatar answered Nov 08 '22 09:11

Zack Evans