Rectangle 27 0

asp.net What is the difference between 'classic' and 'integrated' pipeline mode in IIS7?


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.

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.

Note
Rectangle 27 0

asp.net What is the difference between 'classic' and 'integrated' pipeline mode in IIS7?


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.

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 elements 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.

Note
Rectangle 27 0

asp.net What is the difference between 'classic' and 'integrated' pipeline mode in IIS7?


"You should only add an application to an application pool in Classic mode if the application fails to work in Integrated mode."

@JsonStatham - One reason for this is that Integrated Mode cannot use ASP.NET Impersonation (Sites > YourSite > IIS > Authentication). If you have an Intranet site and are using Windows Authentication, this is an important consideration. link

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.

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.

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.

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.

Why would it fail to work in integrated mode?

Note
Rectangle 27 0

asp.net What is the difference between 'classic' and 'integrated' pipeline mode in IIS7?


@AlexanderN I have not seen a benchmark.

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.

I'd love to see a benchmark comparison

I'm not sure if it's correct to say that asp.net is a part of IIS. They look like a separate (albeit integrated) products. I could be wrong.

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.

Note
Rectangle 27 0

asp.net What is the difference between 'classic' and 'integrated' pipeline mode in IIS7?


ASP.NET modules
IHttpHandler
NON ASP.NET Modules / native IIS modules

IIS 6.0 and previous versions :

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

This is the reason why NON ASP.NET content types (.html, static files ) can be handled by .NET modules.

What's a SCRIPT MAP ?

  • 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.

A good example can be seen here

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.

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 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 )

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.

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

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.

Note
Rectangle 27 0

asp.net What is the difference between 'classic' and 'integrated' pipeline mode in IIS7?


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.

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 elements 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.

Note
Rectangle 27 0

asp.net What is the difference between 'classic' and 'integrated' pipeline mode in IIS7?


@AlexanderN I have not seen a benchmark.

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.

I'd love to see a benchmark comparison

I'm not sure if it's correct to say that asp.net is a part of IIS. They look like a separate (albeit integrated) products. I could be wrong.

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.

Note
Rectangle 27 0

asp.net What is the difference between 'classic' and 'integrated' pipeline mode in IIS7?


"You should only add an application to an application pool in Classic mode if the application fails to work in Integrated mode."

@JsonStatham - One reason for this is that Integrated Mode cannot use ASP.NET Impersonation (Sites > YourSite > IIS > Authentication). If you have an Intranet site and are using Windows Authentication, this is an important consideration. link

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.

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.

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.

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.

Why would it fail to work in integrated mode?

Note
Rectangle 27 0

asp.net What is the difference between 'classic' and 'integrated' pipeline mode in IIS7?


"You should only add an application to an application pool in Classic mode if the application fails to work in Integrated mode."

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.

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.

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.

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.

Note
Rectangle 27 0

asp.net What is the difference between 'classic' and 'integrated' pipeline mode in IIS7?


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.

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.

Note