webapi在IIS发布后报Http 403.14 error

IIS6.1
 
 
解决方法,修改web.config文件
 
1、在<system.webServer>配置节中<modules>添加 runAllManagedModulesForAllRequests="true"
 
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">//增加runAllManagedModulesForAllRequests="true"
      <remove name="FormsAuthentication" />
      <remove name="ApplicationInsightsWebTracking" />
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
    </modules>
    <handlers>
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <remove name="OPTIONSVerbHandler" />
      <remove name="TRACEVerbHandler" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>

 

2、删除<system.web>配置节中的<compilation targetFramework="4.5.2" />
 
    
<system.web>
    <authentication mode="None" />
   <compilation targetFramework="4.5.2" /> //这一条删除
    <httpRuntime />
    <httpModules>
        <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
    </httpModules>
    <pages controlRenderingCompatibilityVersion="4.0" />
</system.web>

 

 

posted @ 2016-07-20 15:26  a-fei  阅读(6348)  评论(1编辑  收藏  举报