2

I get 405 error for PUT action in ASP.NET WebApi.

I read tons of pages, most of them suggest to remove the WebDAVModule module and WebDAV handler. For example: http://forums.iis.net/t/1166025.aspx

So I end up with this:

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <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="*" 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="*" 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="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
  </system.webServer>

However, now I get error code 500.

If I'm using only this:

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <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="*" 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="*" 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="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
  </system.webServer>

I still get 405.

Been wasting my whole day on this. What am I missing? (IIS 7.5)

dsb
  • 2,153
  • 4
  • 22
  • 41
  • I had too many problems with the `WebApi` that I could not solve after trying everything. So I scrapped the idea and went on to use a `Web Service`. Works like magic and less stressful. – Dumisani Apr 23 '14 at 13:38
  • ME TOO! I read somewhere else on Stack overflow that microsoft said you have to disable WebDAV at the site level. Click on your web site, click on the `WebDAV Authoring Rules` feature, then on the side panel, click `Disable WebDAV`. I had to do this in addition to removing the handler and module. I hate this solution though, I wish there was something at the web application level.. Sorry I cant find the link to this solution... – Mr_Moneybags Jan 16 '16 at 01:53
  • Try my solution mentioned [here.](https://stackoverflow.com/a/53341203/268584) – Rajiv Nov 16 '18 at 17:01

0 Answers0