IIS7中的“经典”和“集成”管道模式有什么区别?

时间:2021-12-24 04:02:09

I was deploying an ASP.NET MVC application last night, and found out that it is less work to deploy with IIS7 set to integrated mode. My question is what is the difference? And what are the implications of using one or the other?

我正在部署一个ASP。昨晚NET MVC应用,发现IIS7设置为集成模式部署工作量较少。我的问题是,区别是什么?使用其中一个或另一个的含义是什么?

5 个解决方案

#1


611  

Classic mode (the only mode in IIS6 and below) is a mode where IIS only works with ISAPI extensions and ISAPI filters directly. In fact, in this mode, ASP.NET is just an ISAPI extension (aspnet_isapi.dll) and an ISAPI filter (aspnet_filter.dll). IIS just treats ASP.NET as an external plugin implemented in ISAPI and works with it like a black box (and only when it's needs to give out the request to ASP.NET). In this mode, ASP.NET is not much different from PHP or other technologies for IIS.

经典模式(IIS6和以下的唯一模式)是IIS只直接使用ISAPI扩展和ISAPI过滤器的模式。事实上,在这个模式中,ASP。NET只是一个ISAPI扩展(aspnet_isapi.dll)和一个ISAPI过滤器(aspnet_filter.dll)。IIS处理ASP。NET是一个在ISAPI中实现的外部插件,它的工作方式就像一个黑盒子(只有当它需要向ASP.NET发送请求时)。在这种模式下,ASP。NET与PHP或IIS的其他技术没有多大区别。

Integrated mode, on the other hand, is a new mode in IIS7 where IIS pipeline is tightly integrated (i.e. is just the same) as ASP.NET request pipeline. ASP.NET can see every request it wants to and manipulate things along the way. ASP.NET is no longer treated as an external plugin. It's completely blended and integrated in IIS. In this mode, ASP.NET HttpModules basically have nearly as much power as an ISAPI filter would have had and ASP.NET HttpHandlers can have nearly equivalent capability as an ISAPI extension could have. In this mode, ASP.NET is basically a part of IIS.

另一方面,集成模式是IIS7中的一种新模式,IIS管道与ASP紧密集成(即是相同的)。网络请求的管道。ASP。NET可以看到它想要的每个请求,并在此过程中对其进行操作。ASP。NET不再被视为外部插件。它完全混合并集成在IIS中。在这种模式下,ASP。NET HttpModules的功能基本上与ISAPI过滤器和ASP差不多。NET HttpHandlers可以拥有与ISAPI扩展几乎相同的功能。在这种模式下,ASP。NET基本上是IIS的一部分。

#2


98  

Integrated application pool mode

集成的应用程序池模式

When an application pool is in Integrated mode, you can take advantage of the integrated request-processing architecture of IIS and ASP.NET. When a worker process in an application pool receives a request, the request passes through an ordered list of events. Each event calls the necessary native and managed modules to process portions of the request and to generate the response.

当应用程序池处于集成模式时,您可以利用IIS和ASP.NET的集成请求处理体系结构。当应用程序池中的工作进程接收到请求时,该请求将通过事件的有序列表。每个事件都调用必要的本机和托管模块来处理请求的部分并生成响应。

There are several benefits to running application pools in Integrated mode. First the request-processing models of IIS and ASP.NET are integrated into a unified process model. This model eliminates steps that were previously duplicated in IIS and ASP.NET, such as authentication. Additionally, Integrated mode enables the availability of managed features to all content types.

在集成模式下运行应用程序池有几个好处。首先是IIS和ASP的请求处理模型。NET集成到一个统一的过程模型中。这个模型消除了以前在IIS和ASP中复制的步骤。净,如身份验证。此外,集成模式允许对所有内容类型提供托管特性。

Classic application pool mode

典型的应用程序池模式

When an application pool is in Classic mode, IIS 7.0 handles requests as in IIS 6.0 worker process isolation mode. ASP.NET requests first go through native processing steps in IIS and are then routed to Aspnet_isapi.dll for processing of managed code in the managed runtime. Finally, the request is routed back through IIS to send the response.

当应用程序池处于经典模式时,IIS 7.0处理请求,如IIS 6.0 worker进程隔离模式。ASP。NET请求首先经过IIS中的本地处理步骤,然后路由到Aspnet_isapi。在托管运行时处理托管代码的dll。最后,通过IIS将请求路由回以发送响应。

This separation of the IIS and ASP.NET request-processing models results in duplication of some processing steps, such as authentication and authorization. Additionally, managed code features, such as forms authentication, are only available to ASP.NET applications or applications for which you have script mapped all requests to be handled by aspnet_isapi.dll.

这种分离的IIS和ASP。NET请求处理模型导致一些处理步骤的重复,如身份验证和授权。此外,管理代码特性(如表单验证)只对ASP可用。使用脚本映射要由aspnet_isapi.dll处理的所有请求的NET应用程序或应用程序。

Be sure to test your existing applications for compatibility in Integrated mode before upgrading a production environment to IIS 7.0 and assigning applications to application pools in Integrated mode. You should only add an application to an application pool in Classic mode if the application fails to work in Integrated mode. For example, your application might rely on an authentication token passed from IIS to the managed runtime, and, due to the new architecture in IIS 7.0, the process breaks your application.

在将生产环境升级到IIS 7.0之前,请确保在集成模式下测试现有应用程序的兼容性,并将应用程序分配给应用程序池。如果应用程序不能在集成模式下工作,您应该只在经典模式中向应用程序池添加应用程序。例如,您的应用程序可能依赖于从IIS传递到托管运行时的身份验证令牌,而且由于IIS 7.0中的新体系结构,进程会破坏您的应用程序。

Taken from: What is the difference between DefaultAppPool and Classic .NET AppPool in IIS7?

从:在IIS7中,DefaultAppPool和经典的。net AppPool有什么区别?

Original source: Introduction to IIS Architecture

原始来源:IIS架构简介

#3


10  

IIS 6.0 and previous versions :

IIS 6.0和以前版本:

ASP.NET integrated with IIS via an ISAPI extension, a C API ( C Programming language based API ) and exposed its own application and request processing model.

ASP。NET通过ISAPI扩展、C API(基于C编程语言的API)与IIS集成,并公开了自己的应用程序和请求处理模型。

This effectively exposed two separate server( request / response ) pipelines, one for native ISAPI filters and extension components, and another for managed application components. ASP.NET components would execute entirely inside the ASP.NET ISAPI extension bubble AND ONLY for requests mapped to ASP.NET in the IIS script map configuration.

这有效地公开了两个单独的服务器(请求/响应)管道,一个用于本地ISAPI过滤器和扩展组件,另一个用于托管应用程序组件。ASP。NET组件将完全在ASP中执行。NET ISAPI扩展气泡,仅用于映射到ASP的请求。NET中的IIS脚本映射配置。

Requests to non ASP.NET content types:- images, text files, HTML pages, and script-less ASP pages, were processed by IIS or other ISAPI extensions and were NOT visible to ASP.NET.

请求非ASP。NET内容类型:-图像、文本文件、HTML页面和非脚本的ASP页面,由IIS或其他ISAPI扩展处理,ASP.NET不可见。

The major limitation of this model was that services provided by ASP.NET modules and custom ASP.NET application code were NOT available to non ASP.NET requests

该模型的主要缺陷是ASP提供的服务。NET模块和定制ASP。NET应用程序代码对非ASP是不可用的。网络请求

What's a SCRIPT MAP ?

什么是脚本地图?

Script maps are used to associate file extensions with the ISAPI handler that executes when that file type is requested. The script map also has an optional setting that verifies that the physical file associated with the request exists before allowing the request to be processed

脚本映射用于将文件扩展名与请求文件类型时执行的ISAPI处理程序关联起来。脚本映射还有一个可选设置,该设置在允许处理请求之前验证与请求关联的物理文件是否存在

A good example can be seen here

这里有一个很好的例子

IIS 7 and above

IIS 7及以上

IIS 7.0 and above have been re-engineered from the ground up to provide a brand new C++ API based ISAPI.

IIS 7.0及以上版本已经被重新设计,以提供一个全新的基于c++ API的ISAPI。

IIS 7.0 and above integrates the ASP.NET runtime with the core functionality of the Web Server, providing a unified(single) request processing pipeline that is exposed to both native and managed components known as modules ( IHttpModules )

IIS 7.0及以上版本集成了ASP。NET运行时,具有Web服务器的核心功能,提供一个统一(单个)请求处理管道,该管道同时公开给本地和托管组件,称为模块(IHttpModules)

What this means is that IIS 7 processes requests that arrive for any content type, with both NON ASP.NET Modules / native IIS modules and ASP.NET modules providing request processing in all stages This is the reason why NON ASP.NET content types (.html, static files ) can be handled by .NET modules.

这意味着IIS 7处理任何内容类型的请求,都是非ASP的。NET模块/本机IIS模块和ASP。NET模块在所有阶段提供请求处理,这就是为什么没有ASP。净内容类型(。html,静态文件)可以被。net模块处理。

  • You can build new managed modules (IHttpModule) that have the ability to execute for all application content, and provided an enhanced set of request processing services to your application.
  • 您可以构建新的托管模块(IHttpModule),该模块能够执行所有应用程序内容,并为您的应用程序提供一组增强的请求处理服务。
  • Add new managed Handlers ( IHttpHandler)
  • 添加新的托管处理程序(IHttpHandler)

#4


5  

In classic mode IIS works h ISAPI extensions and ISAPI filters directly. And uses two pipe lines , one for native code and other for managed code. You can simply say that in Classic mode IIS 7.x works just as IIS 6 and you dont get extra benefits out of IIS 7.x features.

在经典模式下,IIS直接工作h ISAPI扩展和ISAPI过滤器。并使用两条管道,一条用于本机代码,另一条用于托管代码。你可以简单地说,在经典模式iis7中。x和iis6一样工作,你不会从iis7得到额外的好处。x特性。

In integrated mode IIS and ASP.Net are tightly coupled rather then depending on just two DLLs on Asp.net as in case of classic mode.

在集成模式IIS和ASP中。Net是紧密耦合的,而不是像经典模式那样依赖于Asp.net上的两个dll。

#5


4  

Classic Mode Typically, moving a Web application from IIS 6.0 to IIS 7.0 Classic mode requires only that you put the application in an application pool that is running in Classic mode. For example, when you install IIS 7.0 with , by default the Web server is configured to operate in Integrated mode. It is also configured to run under the default application pool, which is called DefaultAppPool. To run a Web application in Classic mode, use the Classic.NETAppPool application or create a new application pool that is configured to run in Classic mode. For information about how to create an application pool, see Create an Application Pool. Any custom modules that implement the IHttpModule interface in an application that runs in Classic mode are notified only about pipeline requests that are handled by the ASP.NET runtime. For example, they are notified about requests for an .aspx page. The application life cycle for Classic mode is the same as the life cycle for ASP.NET in IIS 6.0. For more information, see ASP.NET Application Life Cycle Overview for IIS 5.0 and 6.0. If an application that runs in Classic mode contains a handler that requires a script map to handle a custom extension in IIS, you must register the handler in both the httpHandler group and the handler group. You map the custom file-name extension to the ASP.NET ISAPI extension (Aspnet_isapi.dll) by specifying the modules and scriptProcessor attributes in the handler element. These attributes specify that the module that defines the handler is an ISAPI extension, and they specify the path of that extension. This is how IIS 7.0 in Classic mode provides backward compatibility with earlier versions of IIS. However, if you run the application in Integrated mode, you must remove the modules and scriptProcessor attributes. For more information, see How to: Configure an HTTP Handler Extension in IIS. When you move a Web application from IIS 6.0 to Classic mode, it is not guaranteed to work in Integrated mode without changes. If you switch an application from Classic mode to Integrated mode (and change any custom modules and handlers), you might have to make additional changes for the application to run correctly in Integrated mode. The next section in this topic explains how to move an application to IIS 7.0 Integrated mode.

通常,将Web应用程序从IIS 6.0移动到IIS 7.0经典模式只需要将应用程序放在以经典模式运行的应用程序池中。例如,当您安装IIS 7.0时,默认情况下,Web服务器被配置为以集成模式运行。它还被配置为在默认的应用程序池(称为DefaultAppPool)下运行。要以经典模式运行Web应用程序,请使用经典模式。NETAppPool应用程序或创建一个新的应用程序池,配置为以经典模式运行。有关如何创建应用程序池的信息,请参见创建应用程序池。在以经典模式运行的应用程序中实现IHttpModule接口的任何自定义模块只会被通知由ASP处理的管道请求。网运行时。例如,它们会被通知关于.aspx页面的请求。经典模式的应用生命周期与ASP的生命周期相同。净在IIS 6.0。有关更多信息,请参见ASP。iis5.0和6.0的应用程序生命周期概述。如果在经典模式下运行的应用程序包含一个处理程序,它需要一个脚本映射来处理IIS中的自定义扩展,那么您必须在httpHandler组和处理程序组中注册处理程序。将自定义文件名称扩展名映射到ASP。通过指定处理程序元素中的模块和scriptProcessor属性,NET ISAPI扩展(Aspnet_isapi.dll)。这些属性指定定义处理程序的模块是ISAPI扩展,并指定该扩展的路径。这就是经典模式下的IIS 7.0如何与早期版本的IIS向后兼容的原因。但是,如果在集成模式下运行应用程序,则必须删除模块和scriptProcessor属性。有关更多信息,请参见如何:在IIS中配置HTTP处理程序扩展。当您将Web应用程序从IIS 6.0移动到Classic模式时,不能保证在集成模式下工作而不进行更改。如果将应用程序从经典模式切换到集成模式(并更改任何自定义模块和处理程序),则可能需要对应用程序进行额外的更改,以便在集成模式下正确运行。本主题的下一节将解释如何将应用程序移动到IIS 7.0集成模式。

Integrated Mode Web applications that do not include custom modules or handlers will usually work without changes in Integrated mode in IIS 7.0. Web applications that rely on custom modules or handlers require the following steps to enable the application to run in Integrated mode: Register custom modules and handlers in the system.webServer section of the Web.config file by using one of the methods described in the Migrating a Web Config File to Integrated Mode section later in this topic. Define event handlers for HttpApplication request pipeline events like BeginRequest and EndRequest only in the Init method of the custom module. Make sure that you have addressed any issues discussed in the "Known Differences Between Integrated Mode and Classic Mode" section of Upgrading ASP.NET Applications to IIS 7.0: Differences between IIS 7.0 Integrated Mode and Classic mode. Modules that implement the IHttpModule interface are referred to as managed-code modules because they are built by using the .NET Framework. Managed-code modules can be registered at the server level or at the application level. Native-code modules are DLLs (non-managed code) that are registered only at the server level. Core ASP.NET features, such as session state and forms authentication, are implemented as managed modules in Integrated mode. When you move an application from Classic to Integrated mode, you can leave custom modules and handler registrations for Classic mode, or you can remove them. If you do not remove the httpModules and httpHandlers registrations that are used in Classic mode, you must set the validation element’s validateIntegratedModeConfiguration attribute to false to avoid errors. The validation element is a child element of the system.webServer element. For more information, see the section "Disabling the migration message" in ASP.NET Integration with IIS 7.0.

不包含自定义模块或处理程序的集成模式Web应用程序通常不会在IIS 7.0中的集成模式下工作。依赖自定义模块或处理程序的Web应用程序需要以下步骤才能使应用程序在集成模式下运行:在系统中注册自定义模块和处理程序。Web服务器部分。通过使用本主题稍后将Web配置文件迁移到集成模式部分中描述的方法之一来配置文件。仅在自定义模块的Init方法中为HttpApplication请求管道事件定义事件处理程序,如BeginRequest和EndRequest。确保您已经在升级ASP的“集成模式和经典模式之间已知的区别”一节中讨论过任何问题。NET应用到IIS 7.0: IIS 7.0集成模式与经典模式的区别。实现IHttpModule接口的模块称为托管代码模块,因为它们是通过使用。net框架构建的。可在服务器级或应用程序级注册托管代码模块。本机代码模块是dll(非托管代码),仅在服务器级注册。核心ASP。NET特性(如会话状态和表单身份验证)是作为集成模式下的托管模块实现的。当您将应用程序从经典模式移动到集成模式时,您可以将自定义模块和处理程序注册保留为经典模式,也可以删除它们。如果不删除在经典模式中使用的httpmodule和httphandler注册,则必须将验证元素的validateIntegratedModeConfiguration属性设置为false,以避免错误。验证元素是系统的子元素。网络服务器的元素。有关更多信息,请参见ASP中的“禁用迁移消息”一节。NET集成IIS 7.0。

#1


611  

Classic mode (the only mode in IIS6 and below) is a mode where IIS only works with ISAPI extensions and ISAPI filters directly. In fact, in this mode, ASP.NET is just an ISAPI extension (aspnet_isapi.dll) and an ISAPI filter (aspnet_filter.dll). IIS just treats ASP.NET as an external plugin implemented in ISAPI and works with it like a black box (and only when it's needs to give out the request to ASP.NET). In this mode, ASP.NET is not much different from PHP or other technologies for IIS.

经典模式(IIS6和以下的唯一模式)是IIS只直接使用ISAPI扩展和ISAPI过滤器的模式。事实上,在这个模式中,ASP。NET只是一个ISAPI扩展(aspnet_isapi.dll)和一个ISAPI过滤器(aspnet_filter.dll)。IIS处理ASP。NET是一个在ISAPI中实现的外部插件,它的工作方式就像一个黑盒子(只有当它需要向ASP.NET发送请求时)。在这种模式下,ASP。NET与PHP或IIS的其他技术没有多大区别。

Integrated mode, on the other hand, is a new mode in IIS7 where IIS pipeline is tightly integrated (i.e. is just the same) as ASP.NET request pipeline. ASP.NET can see every request it wants to and manipulate things along the way. ASP.NET is no longer treated as an external plugin. It's completely blended and integrated in IIS. In this mode, ASP.NET HttpModules basically have nearly as much power as an ISAPI filter would have had and ASP.NET HttpHandlers can have nearly equivalent capability as an ISAPI extension could have. In this mode, ASP.NET is basically a part of IIS.

另一方面,集成模式是IIS7中的一种新模式,IIS管道与ASP紧密集成(即是相同的)。网络请求的管道。ASP。NET可以看到它想要的每个请求,并在此过程中对其进行操作。ASP。NET不再被视为外部插件。它完全混合并集成在IIS中。在这种模式下,ASP。NET HttpModules的功能基本上与ISAPI过滤器和ASP差不多。NET HttpHandlers可以拥有与ISAPI扩展几乎相同的功能。在这种模式下,ASP。NET基本上是IIS的一部分。

#2


98  

Integrated application pool mode

集成的应用程序池模式

When an application pool is in Integrated mode, you can take advantage of the integrated request-processing architecture of IIS and ASP.NET. When a worker process in an application pool receives a request, the request passes through an ordered list of events. Each event calls the necessary native and managed modules to process portions of the request and to generate the response.

当应用程序池处于集成模式时,您可以利用IIS和ASP.NET的集成请求处理体系结构。当应用程序池中的工作进程接收到请求时,该请求将通过事件的有序列表。每个事件都调用必要的本机和托管模块来处理请求的部分并生成响应。

There are several benefits to running application pools in Integrated mode. First the request-processing models of IIS and ASP.NET are integrated into a unified process model. This model eliminates steps that were previously duplicated in IIS and ASP.NET, such as authentication. Additionally, Integrated mode enables the availability of managed features to all content types.

在集成模式下运行应用程序池有几个好处。首先是IIS和ASP的请求处理模型。NET集成到一个统一的过程模型中。这个模型消除了以前在IIS和ASP中复制的步骤。净,如身份验证。此外,集成模式允许对所有内容类型提供托管特性。

Classic application pool mode

典型的应用程序池模式

When an application pool is in Classic mode, IIS 7.0 handles requests as in IIS 6.0 worker process isolation mode. ASP.NET requests first go through native processing steps in IIS and are then routed to Aspnet_isapi.dll for processing of managed code in the managed runtime. Finally, the request is routed back through IIS to send the response.

当应用程序池处于经典模式时,IIS 7.0处理请求,如IIS 6.0 worker进程隔离模式。ASP。NET请求首先经过IIS中的本地处理步骤,然后路由到Aspnet_isapi。在托管运行时处理托管代码的dll。最后,通过IIS将请求路由回以发送响应。

This separation of the IIS and ASP.NET request-processing models results in duplication of some processing steps, such as authentication and authorization. Additionally, managed code features, such as forms authentication, are only available to ASP.NET applications or applications for which you have script mapped all requests to be handled by aspnet_isapi.dll.

这种分离的IIS和ASP。NET请求处理模型导致一些处理步骤的重复,如身份验证和授权。此外,管理代码特性(如表单验证)只对ASP可用。使用脚本映射要由aspnet_isapi.dll处理的所有请求的NET应用程序或应用程序。

Be sure to test your existing applications for compatibility in Integrated mode before upgrading a production environment to IIS 7.0 and assigning applications to application pools in Integrated mode. You should only add an application to an application pool in Classic mode if the application fails to work in Integrated mode. For example, your application might rely on an authentication token passed from IIS to the managed runtime, and, due to the new architecture in IIS 7.0, the process breaks your application.

在将生产环境升级到IIS 7.0之前,请确保在集成模式下测试现有应用程序的兼容性,并将应用程序分配给应用程序池。如果应用程序不能在集成模式下工作,您应该只在经典模式中向应用程序池添加应用程序。例如,您的应用程序可能依赖于从IIS传递到托管运行时的身份验证令牌,而且由于IIS 7.0中的新体系结构,进程会破坏您的应用程序。

Taken from: What is the difference between DefaultAppPool and Classic .NET AppPool in IIS7?

从:在IIS7中,DefaultAppPool和经典的。net AppPool有什么区别?

Original source: Introduction to IIS Architecture

原始来源:IIS架构简介

#3


10  

IIS 6.0 and previous versions :

IIS 6.0和以前版本:

ASP.NET integrated with IIS via an ISAPI extension, a C API ( C Programming language based API ) and exposed its own application and request processing model.

ASP。NET通过ISAPI扩展、C API(基于C编程语言的API)与IIS集成,并公开了自己的应用程序和请求处理模型。

This effectively exposed two separate server( request / response ) pipelines, one for native ISAPI filters and extension components, and another for managed application components. ASP.NET components would execute entirely inside the ASP.NET ISAPI extension bubble AND ONLY for requests mapped to ASP.NET in the IIS script map configuration.

这有效地公开了两个单独的服务器(请求/响应)管道,一个用于本地ISAPI过滤器和扩展组件,另一个用于托管应用程序组件。ASP。NET组件将完全在ASP中执行。NET ISAPI扩展气泡,仅用于映射到ASP的请求。NET中的IIS脚本映射配置。

Requests to non ASP.NET content types:- images, text files, HTML pages, and script-less ASP pages, were processed by IIS or other ISAPI extensions and were NOT visible to ASP.NET.

请求非ASP。NET内容类型:-图像、文本文件、HTML页面和非脚本的ASP页面,由IIS或其他ISAPI扩展处理,ASP.NET不可见。

The major limitation of this model was that services provided by ASP.NET modules and custom ASP.NET application code were NOT available to non ASP.NET requests

该模型的主要缺陷是ASP提供的服务。NET模块和定制ASP。NET应用程序代码对非ASP是不可用的。网络请求

What's a SCRIPT MAP ?

什么是脚本地图?

Script maps are used to associate file extensions with the ISAPI handler that executes when that file type is requested. The script map also has an optional setting that verifies that the physical file associated with the request exists before allowing the request to be processed

脚本映射用于将文件扩展名与请求文件类型时执行的ISAPI处理程序关联起来。脚本映射还有一个可选设置,该设置在允许处理请求之前验证与请求关联的物理文件是否存在

A good example can be seen here

这里有一个很好的例子

IIS 7 and above

IIS 7及以上

IIS 7.0 and above have been re-engineered from the ground up to provide a brand new C++ API based ISAPI.

IIS 7.0及以上版本已经被重新设计,以提供一个全新的基于c++ API的ISAPI。

IIS 7.0 and above integrates the ASP.NET runtime with the core functionality of the Web Server, providing a unified(single) request processing pipeline that is exposed to both native and managed components known as modules ( IHttpModules )

IIS 7.0及以上版本集成了ASP。NET运行时,具有Web服务器的核心功能,提供一个统一(单个)请求处理管道,该管道同时公开给本地和托管组件,称为模块(IHttpModules)

What this means is that IIS 7 processes requests that arrive for any content type, with both NON ASP.NET Modules / native IIS modules and ASP.NET modules providing request processing in all stages This is the reason why NON ASP.NET content types (.html, static files ) can be handled by .NET modules.

这意味着IIS 7处理任何内容类型的请求,都是非ASP的。NET模块/本机IIS模块和ASP。NET模块在所有阶段提供请求处理,这就是为什么没有ASP。净内容类型(。html,静态文件)可以被。net模块处理。

  • You can build new managed modules (IHttpModule) that have the ability to execute for all application content, and provided an enhanced set of request processing services to your application.
  • 您可以构建新的托管模块(IHttpModule),该模块能够执行所有应用程序内容,并为您的应用程序提供一组增强的请求处理服务。
  • Add new managed Handlers ( IHttpHandler)
  • 添加新的托管处理程序(IHttpHandler)

#4


5  

In classic mode IIS works h ISAPI extensions and ISAPI filters directly. And uses two pipe lines , one for native code and other for managed code. You can simply say that in Classic mode IIS 7.x works just as IIS 6 and you dont get extra benefits out of IIS 7.x features.

在经典模式下,IIS直接工作h ISAPI扩展和ISAPI过滤器。并使用两条管道,一条用于本机代码,另一条用于托管代码。你可以简单地说,在经典模式iis7中。x和iis6一样工作,你不会从iis7得到额外的好处。x特性。

In integrated mode IIS and ASP.Net are tightly coupled rather then depending on just two DLLs on Asp.net as in case of classic mode.

在集成模式IIS和ASP中。Net是紧密耦合的,而不是像经典模式那样依赖于Asp.net上的两个dll。

#5


4  

Classic Mode Typically, moving a Web application from IIS 6.0 to IIS 7.0 Classic mode requires only that you put the application in an application pool that is running in Classic mode. For example, when you install IIS 7.0 with , by default the Web server is configured to operate in Integrated mode. It is also configured to run under the default application pool, which is called DefaultAppPool. To run a Web application in Classic mode, use the Classic.NETAppPool application or create a new application pool that is configured to run in Classic mode. For information about how to create an application pool, see Create an Application Pool. Any custom modules that implement the IHttpModule interface in an application that runs in Classic mode are notified only about pipeline requests that are handled by the ASP.NET runtime. For example, they are notified about requests for an .aspx page. The application life cycle for Classic mode is the same as the life cycle for ASP.NET in IIS 6.0. For more information, see ASP.NET Application Life Cycle Overview for IIS 5.0 and 6.0. If an application that runs in Classic mode contains a handler that requires a script map to handle a custom extension in IIS, you must register the handler in both the httpHandler group and the handler group. You map the custom file-name extension to the ASP.NET ISAPI extension (Aspnet_isapi.dll) by specifying the modules and scriptProcessor attributes in the handler element. These attributes specify that the module that defines the handler is an ISAPI extension, and they specify the path of that extension. This is how IIS 7.0 in Classic mode provides backward compatibility with earlier versions of IIS. However, if you run the application in Integrated mode, you must remove the modules and scriptProcessor attributes. For more information, see How to: Configure an HTTP Handler Extension in IIS. When you move a Web application from IIS 6.0 to Classic mode, it is not guaranteed to work in Integrated mode without changes. If you switch an application from Classic mode to Integrated mode (and change any custom modules and handlers), you might have to make additional changes for the application to run correctly in Integrated mode. The next section in this topic explains how to move an application to IIS 7.0 Integrated mode.

通常,将Web应用程序从IIS 6.0移动到IIS 7.0经典模式只需要将应用程序放在以经典模式运行的应用程序池中。例如,当您安装IIS 7.0时,默认情况下,Web服务器被配置为以集成模式运行。它还被配置为在默认的应用程序池(称为DefaultAppPool)下运行。要以经典模式运行Web应用程序,请使用经典模式。NETAppPool应用程序或创建一个新的应用程序池,配置为以经典模式运行。有关如何创建应用程序池的信息,请参见创建应用程序池。在以经典模式运行的应用程序中实现IHttpModule接口的任何自定义模块只会被通知由ASP处理的管道请求。网运行时。例如,它们会被通知关于.aspx页面的请求。经典模式的应用生命周期与ASP的生命周期相同。净在IIS 6.0。有关更多信息,请参见ASP。iis5.0和6.0的应用程序生命周期概述。如果在经典模式下运行的应用程序包含一个处理程序,它需要一个脚本映射来处理IIS中的自定义扩展,那么您必须在httpHandler组和处理程序组中注册处理程序。将自定义文件名称扩展名映射到ASP。通过指定处理程序元素中的模块和scriptProcessor属性,NET ISAPI扩展(Aspnet_isapi.dll)。这些属性指定定义处理程序的模块是ISAPI扩展,并指定该扩展的路径。这就是经典模式下的IIS 7.0如何与早期版本的IIS向后兼容的原因。但是,如果在集成模式下运行应用程序,则必须删除模块和scriptProcessor属性。有关更多信息,请参见如何:在IIS中配置HTTP处理程序扩展。当您将Web应用程序从IIS 6.0移动到Classic模式时,不能保证在集成模式下工作而不进行更改。如果将应用程序从经典模式切换到集成模式(并更改任何自定义模块和处理程序),则可能需要对应用程序进行额外的更改,以便在集成模式下正确运行。本主题的下一节将解释如何将应用程序移动到IIS 7.0集成模式。

Integrated Mode Web applications that do not include custom modules or handlers will usually work without changes in Integrated mode in IIS 7.0. Web applications that rely on custom modules or handlers require the following steps to enable the application to run in Integrated mode: Register custom modules and handlers in the system.webServer section of the Web.config file by using one of the methods described in the Migrating a Web Config File to Integrated Mode section later in this topic. Define event handlers for HttpApplication request pipeline events like BeginRequest and EndRequest only in the Init method of the custom module. Make sure that you have addressed any issues discussed in the "Known Differences Between Integrated Mode and Classic Mode" section of Upgrading ASP.NET Applications to IIS 7.0: Differences between IIS 7.0 Integrated Mode and Classic mode. Modules that implement the IHttpModule interface are referred to as managed-code modules because they are built by using the .NET Framework. Managed-code modules can be registered at the server level or at the application level. Native-code modules are DLLs (non-managed code) that are registered only at the server level. Core ASP.NET features, such as session state and forms authentication, are implemented as managed modules in Integrated mode. When you move an application from Classic to Integrated mode, you can leave custom modules and handler registrations for Classic mode, or you can remove them. If you do not remove the httpModules and httpHandlers registrations that are used in Classic mode, you must set the validation element’s validateIntegratedModeConfiguration attribute to false to avoid errors. The validation element is a child element of the system.webServer element. For more information, see the section "Disabling the migration message" in ASP.NET Integration with IIS 7.0.

不包含自定义模块或处理程序的集成模式Web应用程序通常不会在IIS 7.0中的集成模式下工作。依赖自定义模块或处理程序的Web应用程序需要以下步骤才能使应用程序在集成模式下运行:在系统中注册自定义模块和处理程序。Web服务器部分。通过使用本主题稍后将Web配置文件迁移到集成模式部分中描述的方法之一来配置文件。仅在自定义模块的Init方法中为HttpApplication请求管道事件定义事件处理程序,如BeginRequest和EndRequest。确保您已经在升级ASP的“集成模式和经典模式之间已知的区别”一节中讨论过任何问题。NET应用到IIS 7.0: IIS 7.0集成模式与经典模式的区别。实现IHttpModule接口的模块称为托管代码模块,因为它们是通过使用。net框架构建的。可在服务器级或应用程序级注册托管代码模块。本机代码模块是dll(非托管代码),仅在服务器级注册。核心ASP。NET特性(如会话状态和表单身份验证)是作为集成模式下的托管模块实现的。当您将应用程序从经典模式移动到集成模式时,您可以将自定义模块和处理程序注册保留为经典模式,也可以删除它们。如果不删除在经典模式中使用的httpmodule和httphandler注册,则必须将验证元素的validateIntegratedModeConfiguration属性设置为false,以避免错误。验证元素是系统的子元素。网络服务器的元素。有关更多信息,请参见ASP中的“禁用迁移消息”一节。NET集成IIS 7.0。