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" />  
    这样可以禁止验证集成模式,避免错误提示。


  • 相关阅读:
    ElasticSearch(5.5.2)在java中的使用
    ElasticSearch基础
    Linux中profile、bashrc、bash_profile之间的区别和联系
    linux上安装启动elasticsearch-5.5.1完整步骤
    linux 解压zip文件
    Ubuntu Linux 环境变量PATH设置
    sudo 用户添加
    SecureCRT5 中文乱码
    韩美林的养生秘诀——“懒人操”
    实验二:线性表的实验【物联网1132-11】
  • 原文地址:https://www.cnblogs.com/zhanghai/p/4922968.html
Copyright © 2011-2022 走看看