WebDAV and WebAPI together cause Error: Handler "ExtensionlessUrlHandler-Integrated-4.0" has a bad module "ManagedPipelineHandler" in its module list

StackOverflow https://stackoverflow.com/questions/17156397

  •  01-06-2022
  •  | 
  •  

Frage

I have both WebDAV installed and running on my site, as a virtual sub site i have a MVC WebAPI site, the API works great, until I try to send a PUT request to it, then i get the below error:

HTTP Error 500.21 - Internal Server Error

Handler "ExtensionlessUrlHandler-Integrated-4.0" has a bad module "ManagedPipelineHandler" in its module list

If I disable WebDAV, then everything works fine and I get no errors. This only happens when WebDAV is enabled.

I have all of the following code in my web.config:

<system.webServer>
  <validation validateIntegratedModeConfiguration="false" />
  <modules runAllManagedModulesForAllRequests="false">
    <remove name="WebDAVModule" />
  </modules>
  <handlers>
    <remove name="WebDAV" />
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
    <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
  </handlers>
</system.webServer>

I've tried messing with various app pools.

I've also tired all of the things mentioned in all of these questions:

How to get rid of this error Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

Handler "ExtensionlessUrlHandler-Integrated-4.0" has a bad module "ManagedPipelineHandler" in its module list

How to fix: Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

None of this has solved my issue, is there anything else out there that I have not tried?

War es hilfreich?

Lösung

We ended up going to Microsoft with this, they reviewed it for several weeks before coming back saying that it's not possible to run WebDAV and WebAPI in the same site.

They will try to address this issue in a future release of IIS.

Andere Tipps

@jblaske has a good response.

If you want to remove it temporarily then maybe this article is the best solution.

If you want to remove the handler all together then follow these steps.

  1. Open IIS and go to the site in question.
  2. Click on "Handler Mappings"
  3. Find the handler named "WebDAV"
  4. Select it and Remove it

This is my original post.

I started getting this error after I removed WebDAV module and handler manually from IIS to get PUT working. I had to remove "WebDAV Publishing" server role to get over this error. After removing this role and restarting the IIS, PUT is working fine.

enter image description here

You might have a typo issue in the declaration of handlers. Thomas Marquardt's Blog says

5.0 Troubleshooting

If you receive an error similar to the one below, your section is probably invalid.

HTTP Error 500.21 - Internal Server Error Handler "" has a bad module "ManagedPipelineHandler" in its module list You probably have a handler mapping that does not have the correct precondition. IIS is not forgiving in regard to typos, and preconditions are case-sensitive. The text must be preCondition=”integratedMode” or preCondition=”classicMode”.

Also, another suggestion from the comments on that article:

Andrew Johnson 25 Jan 2011 3:20 AM #:

I found that I can also get the "Handler has a bad module ManagedPipelineHandler in its module list" if the handler has requireAccess="None". For me, changing this to requireAccess="Read" made the error go away.

That comment might apply to your case as I see that in applicationHost.config the entry for WebDav handlers is (note the requredAccess="None"):

<add name="WebDAV" path="*" verb="PROPFIND,PROPPATCH,MKCOL,PUT,COPY,DELETE,MOVE,LOCK,UNLOCK" modules="WebDAVModule" resourceType="Unspecified" requireAccess="None" />

Found an alternate for this issue. When the patches of the server were pushed,The default framework were set back to 2.0. Re register .Net framework by going to framework 4.0 folder C:\Windows\Microsoft.NET\Framework64\v4.0.30319 Executing the command aspnet_regiis -I

Check the web.config to match the .Net framework version

Go to IIS -> Application pool, set the .Net framework values to 4.0 Restart the IIS.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top