zoukankan      html  css  js  c++  java
  • IIS7中配置集成模式,使其可使用httpModules、httpHandlers【转】

    http://www.cnblogs.com/catcherx/p/3330909.html

    第一种方法:配置应用程序池

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

    第二种方法:修改web.config配置文件:

    例如原先设置(你的环境中可能没有httpModules,httpHandlers节点)

    1. <system.web>  
    2.   
    3.     ............  
    4.   
    5.     <httpModules>  
    6.         <add name="MyModule" type="MyApp.MyModule" />  
    7.     </httpModules>  
    8.     <httpHandlers>  
    9.       <add path="*.myh" verb="GET" type="MyApp.MyHandler" />  
    10.     </httpHandlers>  
    11.    .............  
    12.   
    13. </system.web>  
    <system.web>
    
        ............
    
        <httpModules>
            <add name="MyModule" type="MyApp.MyModule" />
        </httpModules>
        <httpHandlers>
          <add path="*.myh" verb="GET" type="MyApp.MyHandler" />
        </httpHandlers>
       .............
    
    </system.web>
    

     在IIS7应用程序池为“集成模式”时,改为:(httpModules改为modules,httpHandlers改为Handlers了)

    1. <system.web>  
    2.   
    3.     ...........  
    4.   
    5. </system.web>  
    6.   
    7. <system.webServer>  
    8.   
    9.     <modules>  
    10.       <add name="MyModule" type="MyApp.MyModule" />        
    11.     </modules>  
    12.     <handlers>  
    13.       <add name="MyHandler" path="*.myh" verb="GET" type="MyApp.MyHandler" preCondition="integratedMode" />  
    14.     </handlers>  
    15.   
    16. </system.webServer>  
    <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>
    
    </system.webServer>
    

     (如果你的web.config没有httpModules,httpHandlers节点,则直接在节点system.webServer中添加:

       <validation validateIntegratedModeConfiguration="false" />  
    这样可以禁止验证集成模式,避免错误提示。


  • 相关阅读:
    将一个 LIB 中的所有 OBJ 名称和类型输出到一个物理文件
    用一条命令 转换 Iseries tables t到 CSV
    用CL提取系统值
    程式中檢查是否潤年的新方法
    Ubuntu 忘记root密码 和修改密码
    excel 数组公式入门
    BAT批处理
    row_number() over(partition byCOL1 order by COL2)
    row_number( )、rank( )、dense_rank( )、ntile( )函数的用法 (SQL2005以上)
    Sql 常用日期计算
  • 原文地址:https://www.cnblogs.com/zhanghai/p/4922968.html
Copyright © 2011-2022 走看看