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>

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM