Asp.net-mvc – MVC 4. IIS 7.5 PUT returning 405

asp.net-mvchttp-puthttp-status-code-405iis-7.5iis-8

I'm trying to use PUT in an MVC 4 application and I'm getting a 405 error.

In my routing I have a constraint on the route to allow PUT and POST, POST to the endpoint works, PUT fails with a 405.

I've followed the advice here ASP.NET Web API returns 404 for PUT only on some servers and here ASP.NET MVC got 405 error on HTTP DELETE request?

I've also deleted WeDAV from IIS, but I'm still getting the 405. Anybody have any other suggestions?

I'm also having exactly the same issue on IIS 8 (with Visual Studio 2012), for that I've followed this advice ASP.NET Web API – PUT & DELETE Verbs Not Allowed – IIS 8 and still no luck

Best Answer

My hosting provider could NOT uninstall WebDAV as this would affect everyone.

This, runAllManagedModulesForAllRequests="true" , worked but was not recommended.

Many fixes included removing the module for WebDAVModule but that still didn't work. I removed the handler also, and finally I could use all verbs POST GET PUT DELETE.

Remove WebDAVModule and WebDAV in modules and handlers.

<modules>
    <remove name="WebDAVModule" />
</modules>
<handlers>
    <remove name="WebDAV" />
</handlers>