• ASP.NET 之 检测到在集成的托管管道模式下不适用的ASP.NET设置


      将ASP.NET程序从IIS6移植到IIS7后,调试运行可能提示以下错误:

      HTTP 错误 500.23 - Internal Server Error

      检测到在集成的托管管道模式下不适用的 ASP.NET 设置。

      为什么会出现以上错误?

      在IIS7的应用程序池有两种模式,一种是“集成模式”,一种是“经典模式”。

      经典模式 则是我们以前习惯的IIS 6 的方式。

      如果使用集成模式,那么对自定义的httpModules 和 httpHandlers 就要修改配置文件,需要将他们转移到<modules>和<hanlders>节里去。

      两种解决方法:

      解决方案一:配置应用程序池

      在IIS7上配置应用程序池,并且将程序池的模式改为“经典”,之后一切正常。如图:

      

      解决方案二:修改web.config配置文件

      例如原先设置

    <system.web>
    
        ............
    
        <httpModules>
            <add name="MyModule" type="MyApp.MyModule" />
        </httpModules>
        <httpHandlers>
          <add path="*.myh" verb="GET" type="MyApp.MyHandler" />
        </httpHandlers>
    </system.web>

      在IIS7应用程序池为“集成模式”时,改为

    <system.web>
    
        ...........
    
    </system.web>
    
    <system.webServer>
        <modules>
          <add name="MyModule" type="MyApp.MyModule" />      
        </modules>
        <handlers>
          <add name="MyHandler" path="*.myh" verb="GET" type="MyApp.MyHandler" preCondition="integratedMode" />
        </handlers>
        <validation validateIntegratedModeConfiguration="false" />
    </system.webServer>

      如果想保留原先设置,更改后可以设置禁止验证集成模式(validateIntegrateModeConfiguration="false"),是不会产生错误的。

  • 相关阅读:
    SPOJ ORDERSET
    BZOJ 1109: [POI2007]堆积木Klo
    BZOJ 1112: [POI2008]砖块Klo
    BZOJ 4144: [AMPPZ2014]Petrol
    BZOJ 4385: [POI2015]Wilcze doły
    BZOJ 1124: [POI2008]枪战Maf
    BZOJ 1123: [POI2008]BLO
    BZOJ 1121: [POI2008]激光发射器SZK
    BZOJ 1131: [POI2008]Sta
    BZOJ 4551: [Tjoi2016&Heoi2016]树
  • 原文地址:https://www.cnblogs.com/xinaixia/p/4698522.html
Copyright © 2020-2023  润新知