zoukankan      html  css  js  c++  java
  • 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"),是不会产生错误的。

  • 相关阅读:
    poj1904 King's Quest
    ACM竞赛须掌握的知识 以及 2个版本的POJ推荐 @ NKOJ discuss 转载的
    poj1466
    C++23中设计模式的factory模式
    poj3667 hotel
    poj1505 Copying Books
    在linux系统中安装VSCode(Visual Studio Code)
    Spring_的jar详细说明
    java开发问题总结4Maven使用问题汇总
    线程同步之信号量(sem_init,sem_post,sem_wait)
  • 原文地址:https://www.cnblogs.com/xinaixia/p/4698522.html
Copyright © 2011-2022 走看看