IIS7.5 application pool integration mode and Classic mode introduction _win server

Source: Internet
Author: User

In IIS 7.5, the application pool has two modes of operation: Integrated mode and Classic mode.

The application pool pattern affects how the server handles requests for managed code.

If the managed application is running in an application pool with integrated mode, the server will use the integrated request processing pipeline of IIS and asp.net to process the request.

If a managed application is running in a classic-mode application pool, the server continues to route managed code requests through aspnet_isapi.dll, which processes the request as if the application were running in IIS 6.0.

Classic mode:

Refers to a pattern that is compatible with IIS 6 or previous versions, and a typical problem is that when dealing with a dynamic web site like asp.net, it works as a plug-in by means of a so-called ISAPI program. Different ISAPI is required for different dynamic applications, such as asp,php.

Integration mode:

This new paradigm allows us to better integrate asp.net with IIS, and even allows us to write functions (such as module) in asp.net to change the behavior (extension) of IIS. The benefit of integration is that you can no longer use ISAPI to improve speed and stability. As for extensions, you can make us more control over IIS and other types of requests.

There are a number of problems in the upgrade process, as mentioned in the previous article. This is the main introduction of the next HttpHandler and HttpModule in the integration and Classic mode of the difference. Many file uploads and so on need to use to HttpModule to realize. I'm going to be here today. Neatupload An error that does not reference an object to a design instance is present under iis7.5. So use HttpModule as a test case.

1. New test Site WebApplication, add Myhttpmodule class to implement IHttpModule interface, the main purpose is to test whether the program has been HttpModule, after the page output HttpModule characters.

public class Myhttpmodule:ihttpmodule 
{public 
void Dispose () 
{ 
} public 
void Init ( HttpApplication context) 
{context 
. BeginRequest + + context_beginrequest; 
} 
protected void Context_beginrequest (object sender, EventArgs e) 
{ 
var context = sender as Httpapplication;
   context. Response.Clear (); 
Context. Response.Write ("HttpModule"); 
Context. Response.End (); 
} 
 


2, 2. Deploy the Web site in IIS7.5, using the Classic mode application pool first. In Web.config's <system.web> sub-node

 


Visit the Web site can find the page output as follows, indicating that the program passed HttpModule

Directly switching the application pool into integrated mode will find that the page output is empty. The certification procedure has not been httpmodule. How can HttpModule be implemented in Integrated mode? When you deploy Urlrewriter, you only know what you need <system.webServer> <modules> registration HttpModule. A careful look at the configuration file will find a paragraph as follows in English. The meaning is probably the IIS7 version of the setting. Previous versions do not need to be set.
<!--
The system.webserver required for running ASP.net AJAX under Internet
Information Services 7.0. It is isn't necessary for previous version of IIS.
-->
This probably means that some of the web configurations are moved to system.webserver after iis7.0. Check the relevant get the answer yes so detailed information see http://www.cnblogs.com/buaaboyi/archive/2011/01/20/1939903.html

So in <system.webServer> <modules> add configuration as follows, refresh the page, the page can output character HttpModule, proved successful.

<system.webServer> 
<validation validateintegratedmodeconfiguration= "false"/> 
<modules > 
<remove name= "Scriptmodule"/> <add name= "Myhttpmodule" type= 
, WebApplication "/> 
<add name=" Scriptmodule "precondition=" Managedhandler "type=" System.Web.Handlers.ScriptModule, System.Web.Extensions, version=3.5.0.0, Culture=neutral, publickeytoken= 31bf3856ad364e35 "/> 
</modules>

Due to an HTTP error in the upgrade process, 500.22-internal Server error detects asp.net settings that are not applicable in integrated managed piping mode


At that time in a more urgent situation directly deleted the <system.web> child node
After this today's toss is finally on the deployment of iis7.5 have a certain understanding.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.