asp.net web api http put delete , iis 返回400.0 找不到错误的解决办法.

来源:互联网 发布:港澳资讯点金手软件 编辑:程序博客网 时间:2024/05/17 02:36

记录一下出问题前我的iis配置:

1. 应用程序池:



错误是:




尝试解决办法(都不行):

<system.webServer>    <validation validateIntegratedModeConfiguration="false" />    <modules runAllManagedModulesForAllRequests="true" />        <handlers>            <remove name="ExtensionlessUrlHandler-Integrated-4.0" />            <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />        </handlers></system.webServer>


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





最后的解决办法如下:

  1. Delete WebDAV from "Modules"
  2. Delete WebDAV from "Handler Mappings"
  3. I delete WebDAV from IIS components to make sure WebDAV not exists and restart Windows
  4. Go to "Handler Mappings" and find ExtensionlessUrlHandler (for 32 and 64 and Integrated), open it and go to "Request Restrictions" to second chapter "Verbs" and put some of the methods you need to the string. I have the next: GET,HEAD,POST,DEBUG,PUT I repeat the changes for three "ExtensionlessUrlHandler" states.
  5. I do not change Request Filtering settings
当然, 也要检查一下iis整体的谓词配置:

请求筛选-->http谓词设置:




最后正常运行的配置是:

只保留了"最后的解决办法"那个小节里的配置. 其他配置都按照iis默认配置



0 0
原创粉丝点击