Visual Studio的HttpModule不运行?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (47)

配置如下所示:

<system.webServer>
        <modules>
            <add name="MinimizeModule" type="ClipperHouse.UrlMinimizer.MinimizeModule" />
        </modules>...
提问于
用户回答回答于

如果在IIS 7上运行:

<configuration>
   <system.webServer>
      <modules>
         <add name="MinimizeModule" type="ClipperHouse.UrlMinimizer.MinimizeModule" />
      </modules>
   </system.webServer>
</configuration>

如果在Cassini(VisualStudio的集成微型Web服务器)上运行,请将模块放在:

<configuration>
   <system.web>
      <httpModules>
          <add name="MinimizeModule" type="ClipperHouse.UrlMinimizer.MinimizeModule" />
   </system.web>
</configuration>

确保部署web.config

<system.web>
   <!--The Cassini location to add modules (comment out for IIS)-->
   <httpModules>
      <!--WARNING: IIS will crash if you leave this in here.
          IISBUG: IIS doesn't support system.web/httpModules, 
          and Cassini doesn't support system.webServer/modules
      -->
      <!--Comment out for IIS-->
      <add name="PerformanceHttpModule" type="DummyPlaceholder.PerformanceHttpModule"/>
   </httpModules>
</system.web>

<system.webServer>
   <!--The IIS7 location to add modules (comment out for Cassini)
   <modules runAllManagedModulesForAllRequests="true">
      <!--IIS7 will crash if you present a system.web httpModules. -->
      <remove name="PerformanceHttpModule" />
      <add name="PerformanceHttpModule" type="DummyPlaceholder.PerformanceHttpModule"/>
   </modules>
</system.webServer>
用户回答回答于

使用IIS 6模块语法

<system.web>
  <httpModules>
    <add name="MinimizeModule" type="ClipperHouse.UrlMinimizer.MinimizeModule" />
  </httpModules>
</system.web>


<system.webServer>
  <validation validateIntegratedModeConfiguration="false"/>
  <modules>
    <remove name="MinimizeModule" />
    <add name="MinimizeModule" type="ClipperHouse.UrlMinimizer.MinimizeModule" 
         preCondition="managedHandler" />
  </modules>
</system.webServer>

所属标签

可能回答问题的人

  • 嗨喽你好

    7 粉丝480 提问8 回答
  • uncle_light

    5 粉丝518 提问7 回答
  • Richel

    4 粉丝0 提问6 回答
  • 人生的旅途

    10 粉丝484 提问6 回答

扫码关注云+社区

领取腾讯云代金券