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
Install .Net Core 2.2 run-time bundle on hosting machine.
Or
Publish your project as self-contained.
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.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With