IIS7.5 differences between application pool integration mode and Classic Mode

Source: Internet
Author: User

There are many problems during the upgrade process, as mentioned in the previous article. This article mainly introduces the differences between httpHandler and httpModule in integration and classic mode. You must use httpModule to upload many files. Today, I encountered a NeatUpload error in iis7.5 that did not reference the object to the design instance. Therefore, httpModule is used as a test case.

1. Create a test website WebApplication and add the MyHttpModule class to implement the IHttpModule interface. The main purpose is to test whether the program has passed the HttpModule and output the HttpModule character on the page.

Copy codeThe Code is as follows: 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 website on IIS7.5, first use the classic-mode application pool. Add <add name = "MyHttpModule" type = "WebApplication. MyHttpModule, WebApplication"/> to the <system. web> sub-node Copy codeThe Code is as follows: <Remove verb = "*" path = "*. asmx"/>
<Add verb = "*" path = "*. asmx "validate =" false "type =" System. web. script. services. scriptHandlerFactory, System. web. extensions, Version = 3.5.0.0, Culture = neutral, PublicKeyToken = 31BF3856AD364E35 "/>
<Add verb = "*" path = "* _ AppService. axd "validate =" false "type =" System. web. script. services. scriptHandlerFactory, System. web. extensions, Version = 3.5.0.0, Culture = neutral, PublicKeyToken = 31BF3856AD364E35 "/>
<Add verb = "GET, HEAD" path = "ScriptResource. axd "type =" System. web. handlers. scriptResourceHandler, System. web. extensions, Version = 3.5.0.0, Culture = neutral, PublicKeyToken = 31BF3856AD364E35 "validate =" false "/>
</HttpHandlers>
<HttpModules>
<Add name = "MyHttpModule" type = "WebApplication. MyHttpModule, WebApplication"/>
<Add name = "ScriptModule" type = "System. Web. Handlers. ScriptModule, System. Web. Extensions, Version = 3.5.0.0, Culture = neutral, PublicKeyToken = 31BF3856AD364E35"/>
</HttpModules>

After accessing the website, the page output is as follows, indicating that the program has passed the HttpModule

Directly switch the application pool to the integration mode, and the page output is blank. The program has not passed the HttpModule. In integration mode, how can the HttpModule be executed? Before URLRewriter is deployed, you only need to <system. webServer> <modules> to register HttpModule. After carefully checking the configuration file, you will find that there is a piece of English, which means the iis7 configuration. You do not need to set the previous version.
<! --
The system. webServer section is required for running ASP. net ajax under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
This means that some web configurations are moved to system. webServer after iis7.0. Please refer to http://www.cnblogs.com/buaaboyi/archive/2011/01/20/1939903.html for more information.

Therefore, add the following configuration in <system. webServer> <modules> and refresh the page. The page can output the character HttpModule, which proves that the configuration is successful.Copy codeThe Code is as follows: <system. webServer>
<Validation validateIntegratedModeConfiguration = "false"/>
<Modules>
<Remove name = "ScriptModule"/>
<Add name = "MyHttpModule" type = "WebApplication. MyHttpModule, WebApplication"/>
<Add name = "ScriptModule" preCondition = "managedHandler" type = "System. web. handlers. scriptModule, System. web. extensions, Version = 3.5.0.0, Culture = neutral, PublicKeyToken = 31BF3856AD364E35 "/>
</Modules>

Because an HTTP Error 500.22-Internal Server Error occurs on a site during the upgrade process, ASP. NET settings that are not applicable in integrated managed pipeline mode are detected.


At that time, the <system. web> sub-node

After all these hard work, I finally learned a little about the deployment on iis7.5.

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.