为 .net 3.5 应用程序启用 Http PUT。收到错误 405.0 - 方法不允许

Enable Http PUT for .net 3.5 application. getting error 405.0 - Method Not Allowed

我在使用请求类型 PUT 发布 http 时遇到问题,它在 IIS 上未启用,有人可以帮助我了解如何通过 web.config 更改启用 PUT 请求类型。

失败的请求跟踪日志:

<failedRequest url="http://localhost:80/.../TestHandler.ashx"
               siteId="1"
               appPoolId="DefaultAppPool"
               processId="10708"
               verb="PUT"
               remoteUserName=""
               userName=""
               tokenUserName="NT AUTHORITY\IUSR"
               authenticationType="anonymous"
               activityId="{00000000-0000-0000-3D85-0580000000FE}"
               failureReason="STATUS_CODE"
               statusCode="405"
               triggerStatusCode="405"
               timeTaken="0"
               xmlns:freb="http://schemas.microsoft.com/win/2006/06/iis/freb"
               >

编辑: 我的机器上没有安装 WebDAV 模块,我的一位同事在他的机器上安装了它。尝试了下面提到的解决方案,但没有用。

Faizan 请尝试在 "405 method not allowed" in IIS7.5 for "PUT" method

它指出 有时您需要从模块和 system.webServer 部分的处理程序中删除 WebDAV。这是我建议的配置:

<system.webServer>
    <modules>
        <remove name="WebDAVModule" />
    </modules>
    <handlers>
        <remove name="WebDAV" />
    </handlers>
</system.webServer>