What is the difference between 'classic' and 'integrated' pipeline mode in IIS7?
Asked Answered
S

4

525

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?

Sporophore answered 3/4, 2009 at 23:10 Comment(3)
How was it less work to deploy with integrated mode vs classic? Just curiousIslean
@Peter: extensionless URLs require being mapped manually in classic mode.Garaway
even in the MVC Global.asax the notes read: For instructions on enabling IIS6 or IIS7 classic mode, visit go.microsoft.com/?LinkId=9394801. Or you can just turn on integrated mode and include the System.Web.Mvc assembly and everything just works.Sporophore
G
670

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.

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.

Garaway answered 3/4, 2009 at 23:22 Comment(8)
is integrated slower than classic?Viveca
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.Mario
@MehrdadAfshari Does dealing with HttpModules methods/events in iis7 has more functionality than in iis6 ? can you elaborate on that ?Oblast
And to add, in Integrated Pipeline mode, every stage in the request pipeline is exposed as an event the mapping of the handlers could be overridden in the application. For example, one can define an embedded resource HttpHandler, for certain kind of routes and map them to your custom handler via the route handler.Guiscard
A perfect answer to such question, should at least refer to one of the Microsoft articles, such as iis.net/learn/application-frameworks/….Pother
i know this has been posted years ago. may i ask a dumb question as to how to change the pipeline mode on a webapp in vs2012?Crespi
Just to answer you years later :-) Select your project then hit f4, it's in the propertiesIngamar
Integrated Pipeline Mode is more secure than Classic Mode because it is part of IIS and It is preferred by Microsoft.Fortitude
P
127

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.

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.

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.

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.

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.

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

Original source: Introduction to IIS Architecture

Ptyalin answered 28/12, 2012 at 9:42 Comment(2)
Key sentence in last paragraph: "You should only add an application to an application pool in Classic mode if the application fails to work in Integrated mode."Garrard
@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. linkHazardous
S
11

IIS 6.0 and previous versions :

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.

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.

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.

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

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

A good example can be seen here

IIS 7 and above

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 )

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.

  • 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.
  • Add new managed Handlers ( IHttpHandler)
Symbolics answered 25/9, 2015 at 15:25 Comment(0)
I
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.

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.

Ingoing answered 3/4, 2009 at 23:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.