Enabling html PUT method on IIS 7.5

2019-05-03 09:44发布

问题:

I'm doing a iCal Service to allow sync between Calendar instances and runs fantastic on localhost (under VS2010 Web Server)

But now That I hosted on a Windows 2008 R2 (IIS 7.5.7600) I couldn't create not even update an event :-o

Thunderbird always said

So I rush into Fiddler and found out the problem

a 405 error

That says PUT is not allowed :(

How can I enabled this method? Application Pool? WebSite definition? IIS Settings?

回答1:

We just need to remove the WebDav Service

Control Panel > Program and Features > Turn Windows features on or off

then navigate to Server Manager > Roles > Web Server (IIS) and wait until Roles Services come up.

Then Remove Role Service and Remove WebDAV Publishing

You need to restart the Server to finalize this action.

I hope it helps someone



回答2:

You can do it from configuration file.

<system.webServer>
<handlers>
<remove name="WebDAV" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
      <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" />
</handlers>
</system.webServer>

Source: http://www.asp.net/web-api/overview/testing-and-debugging/troubleshooting-http-405-errors-after-publishing-web-api-applications