我对system.web中的system.web和system.webServer中的处理程序感到困惑。这两种配置有什么区别?以及如何和何时使用它们?
实际上,另一个问题也适用于模块: httpModules在system.web中,模块在system.webServer中
发布于 2015-06-15 04:42:39
system.webServer文件中的Web.config部分指定应用于Web.config应用程序的IIS7.0设置。system.WebServer是配置部分的子部分。有关更多信息,请参见IIS7.0: system.webServer节组(system.webServer)。
<system.web>为ASP.NET配置部分指定根元素,并包含配置元素,用于配置ASP.NET Web应用程序并控制应用程序的行为。httpHandlers和handlers是一样的。
要为IIS 6.0注册HTTP处理程序,应:
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="SampleHandler.new"
type="SampleHandler, SampleHandlerAssembly" />
</httpHandlers>
</system.web>
</configuration>要为IIS 7.0注册HTTP处理程序,应:
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="SampleHandler.new"
type="SampleHandler, SampleHandlerAssembly" />
</httpHandlers>
</system.web>
<system.webServer>
<add name=SampleHandler" verb="*" path="SampleHandler.new"
Modules="IsapiModule"
scriptProcessor="FrameworkPath\aspnet_isapi.dll"
resourceType="File" />
</system.webServer>
</configuration>阅读更多这里
发布于 2015-06-15 05:49:24
<system.web>是asp.net的配置部分,传统上这是定义httpHandlers和httpModules的地方。
随着IIS7 (2007)的引入,web服务器与asp.net的集成程度越来越高,并引入了全新的IIS配置系统。
作为其中的一部分,处理程序和模块定义的位置被移到<system.webServer>中。
如果您仍在使用IIS6 (停止它)或在IIS7+中使用经典管道模式,则需要在<system.web>下使用定义,如果在IIS7+中使用集成管道模式,则将它们放在<system.webServer>下。你不应该在这两个部分都有它们。
https://stackoverflow.com/questions/30837409
复制相似问题