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


  • 相关阅读:
    mui 时间选择器和上传图片
    css实现聊天气泡效果
    css总结 -使用display:inline-block,出现元素高度错位
    js DIV延时几秒后消失或显示代码
    js监听textarea 内容的变化,并计算内容的长度c
    生成git的SSH公钥
    IDEA中把普通的Java项目转换成gradle项目
    Idea中自动生成get,set,toString等方法
    IDEA中阿里P3C插件的安装与使用
    IDEA中SonarLint的安装与使用
  • 原文地址:https://www.cnblogs.com/zhanghai/p/4922968.html
Copyright © 2011-2022 走看看