【问题标题】:Are the old httpHandlers and httpModules elements needed in IIS7?IIS7 中是否需要旧的 httpHandlers 和 httpModules 元素?
【发布时间】:2010-05-09 01:46:58
【问题描述】:

我想清理 web.config 并删除不需要的 XML。

默认的 ASP.NET 3.5 Web 应用程序在 web.config 中有以下元素:

<httpHandlers>
  <remove verb="*" path="*.asmx"/>
  <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>

<httpModules>
  <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>

在 IIS7 下运行时,在 system.webServer 元素下注册了模块和处理程序,是否还需要上述配置?

【问题讨论】:

    标签: asp.net iis-7 web-config


    【解决方案1】:

    是的,如果您仅在 IIS7 上运行,您可以删除 httpHandlershttModules 部分。

    如您所见,相同的类型正在使用略有不同的架构注册。

    【讨论】:

      猜你喜欢
      • 2011-02-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多