15

I've created an OData service (WCF Data Service), and a consumer to test it.

Previously, when I attempted to delete, I got the WebDAV 405 error message, "Method Not Allowed".

So I googled and found:

http://nikhilthaker86.wordpress.com/2010/03/27/issue-hosting-restful-services-on-iis-7/

I followed the instructions and removed the WebDav module from my website (service) in IIS 7.

Now I get this error message instead:

"HTTP Error 500.21 - Internal Server Error

Handler "WebDAV" has a bad module "WebDAVModule" in its module list

Module: IIS Web Core Notification: ExecuteRequestHandler"

If you have a solution that will make this problem go away, I would really appreciate it... otherwise, if you're an IIS guru, and you're thinking "This guy has no idea what he's doing", please point me in the direction of some useful online reading material.

Thanks in advance.

jotik
  • 14,982
  • 9
  • 48
  • 106
Stephen Oberauer
  • 4,898
  • 5
  • 48
  • 72

1 Answers1

36

The WebDAV module will block both the DELETE and PUT (update) verbs for IIS. You can either uninstall WebDAV (recommended) or simply remove it from the Handlers of the site. More details can be found here: http://forums.iis.net/t/1166025.aspx

One way to do this is to add the following remove lines to your site's web.config:

<system.webServer>
    <modules>
        <remove name="WebDAVModule" />
    </modules>
    <handlers>
        <remove name="WebDAV" />
    </handlers>
</system.webServer>
Craig Stuntz
  • 123,797
  • 12
  • 247
  • 268
TRayburn
  • 1,535
  • 12
  • 10
  • Thanks for this. After following instructions from the site at the link you provided, it worked! Run IIS7, select the site, open modules from the features view, remove WebDAV, open handler mappings from features view, remove WebDAV. Restart IIS7. – Stephen Oberauer Jul 15 '11 at 09:21
  • 1
    This solved our problem, too. I added the web.config example from the link @TRayburn provided, as I think it's better than the manual method. – Craig Stuntz Aug 31 '11 at 13:14
  • 3
    This was driving me nuts. I had removed the `WebDAVModule` but forgot the handler. It was throwing 500 errors until I removed `WebDAV` too. – CBono Aug 19 '13 at 13:42
  • 1
    Just to add to this answer: The LiveStreamingHandler from the IIS Media services might also block the DELETE and PUT verbs. – Malyngo Oct 24 '13 at 16:07