5
votes

I built a basic RESTful web service so that I can receive events. I can run this fine on local IIS, but have the following error when publishing it in IIS 10 on a server

HTTP Error 500.21 - Internal Server Error Handler "ExtensionlessUrlHandler-Integrated-4.0" has a bad module "ManagedPipelineHandler"

I set the application pool Managed Pipeline Mode to Integrated and enabled Directory Browsing in the app features. My web config looks like this:

<system.webServer>
<modules>
  <remove name="UrlRoutingModule-4.0" />
  <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
<handlers>
  <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
  <remove name="OPTIONSVerbHandler" />
  <remove name="TRACEVerbHandler" />
  <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>

If I change the application pool Managed Pipeline Mode to "Classic" I can actually see the root site but trying to browse or call to the API gives 404s (such as xx.x.xxx.x/api/Controller/Action).

3
@christok Yes, apparently if IIS is installed after .NET then you have to go back in to server roles/features and enable .NET 4.6john smith
Question .Net is installed as well as IIS in roles/features do I need to reinstall it ?Micah Armantrout
@MicahArmantrout Shouldn't have to. Go back to the roles/features and find .Net and see if 4.6 is checked/enabledjohn smith
it is enabled and IIS is installed but I am still getting this errorMicah Armantrout
I did notice that my application is for 4.5 and not 4.6 so maybe I need to install 4.5Micah Armantrout

3 Answers

15
votes

Using IIS 10 and .NET 4.6

  1. Add roles and Features
  2. Open up child nodes for WEB Server IIS
  3. Under Web Server, open nodes for Application Development
  4. Select ".NET Extensibility 4.6", "ASP.NET 4.6"

These resolves the problem.

2
votes

In Windows 10 I was able to resolve this via:

  1. Control Panel > Programs & Features > Turn Windows features on or off
  2. Removing .NET Framework 4.7 Advanced Services > ASP.NET 4.7
  3. Adding it back
0
votes

for anyone else that runs into this I installed ASP.net 4.6 on Server 2016 in add remove roles and this resolved my issue.