The difference analysis of IIS7 Classic mode and integration mode _win server

Source: Internet
Author: User
Tags configuration settings
Classic mode is for compatibility with previous versions, using ISAPI extensions to invoke the ASP.net runtime, and migrating Web applications running under IIS6.0 to IIS7.0 as long as the application is configured in Classic mode, the code can run normally without modification. Integrated mode is a unified pleading processing pipeline that combines the ASP.net request pipeline with the IIS core pipeline, which provides better performance, enables configuration and governance modularity, and increases the flexibility of using managed code modules to extend IIS. If an older Web application is running in IIS7.0 Integrated mode, it may be necessary to modify the application's Web.config file, especially with the custom modules that implement the IHttpHandler interface. IIS7.0 applications that can support both modes on the same server.

IIS6.0 the asp.net MMC snap-in is used to configure the admin domain of the application in asp.net,7.0 asp.net is more tightly integrated, there are no separate snap-ins, and all IIS and ASP.net configurations are done using IIS Manager. IIS7.0 configuration information is based on the. NET Framework configuration system, Therefore, the Web.config file for the application running in IIS7.0 contains both the Web server and asp.net configuration settings, such as the mapping of the extension and file in the Web.config file (which must be configured in IIS in IIS6.0).

Changes in Web.config files

The system.webserver section specifies the IIS7.0 setting that is applied to the Web application, and its parent is configuration, which can be set in a node that includes the following:

The default document (Defaultdocument) that the Web server returns to the client when the request does not contain the specified resource, the compression settings (httpcompression) for the response (Customheaders of the Httpprotocol section) Module (modules) handler (handlers)

Some of these settings apply only to Integrated mode and not to Classic mode. Applications running in Classic mode ignore all managed code modules and handlers specified in the Web.config system.webserver section, where Web applications should define modules and processes in the httpmodules and httphandlers of the Syste.web section Order.

Migrating WEB applications to Integrated mode

Web applications that do not contain custom modules or handlers typically do not need to be changed to work in IIS 7 set mode. For WEB applications that rely on custom modules or handlers, you need to perform the following steps to enable them to run in Integrated mode:

Use one of the methods described later in this topic to migrate the Web Config file to the Integrated mode section, registering the custom module and handler in the system.webserver section of the Web.config file.

The event handlers for HttpApplication request pipeline events, such as BeginRequest and endrequest, are defined only in the Init method of the custom module.

Make sure that you have resolved upgrading ASP.net applications to IIS 7.0:differences between IIS 7.0 Integrated mode and Classic mode (asp.net "Known differences Between Integrated mode and Classic mode" (known differences between integration mode and Classic mode), the application upgrades to the difference between the IIS 7.0:iis 7 set mode and Classic mode Issues to be discussed.

The modules that implement the IHttpModule interface are called managed code modules because they are generated using the. NET framework. Managed code modules can be registered at the server level or at the application level. Native code modules are DLLs that are registered only at the server level (unmanaged code). In integrated mode, core asp.net functionality, such as session state and forms authentication, is implemented as a managed module.

When migrating an application from Classic mode to Integrated mode, you can retain custom modules and handler registrations in Classic mode, or you can remove these registrations. If you do not remove the httpmodules and httphandlers registrations used in Classic mode, you must set the validateIntegratedModeConfiguration property of the validation element 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" (Disable migration messages) in ASP.net integration with IIS 7.0 (set asp.net with IIS 7).

Migrate web.config files for use in Integrated mode

If a module or handler is defined at the application level, the module or handler is not invoked automatically. This involves a module or handler that is defined in an assembly under the Bin folder, is defined as a source code under the App_Code folder, and is not registered and defined in the system.webserver section of the Web.config file. In order for a module or handler to participate in an integrated mode request pipeline, you must register the module or handler by using one of the following methods:

Edit the Web.config file directly and add modules or handlers elements to the system.webserver element. Please note that the element name is different than the Classic mode: modules and handlers correspond to the classical mode of httpmodules and httphandlers respectively.

Use IIS Manager to configure a module or handler. For more information, see Configuring Handler Mappings in IIS 7.0 (configuring Handler Mappings in IIS 7.0) and configuring Modules in IIS 7.0 (configuring modules in IIS 7.0).

Use the IIS 7.0 command line tool (Appcmd.exe). For more information, see Configure Settings for a site application Virtual Directory or URL by using Appcmd.exe (using Appcmd.exe to configure sites, applications, The settings for the virtual directory or URL.

Classes and attributes used in integrated mode

These classes and members that are not available in Classic mode can be used when you use the application in IIS 7 set mode and the. NET Framework version 3.0 or later:

The Substatuscode property of the HttpResponse object that you can use to set code that is useful in situations where failed request tracking is configured. For more information, see Troubleshooting Failed Requests using Failed Request Tracing in IIS 7.0 (using the Tracing feature in IIS 7.0 to troubleshoot requests that failed).

The Headers property of the HttpResponse object that can be used to access the response header.

The Ispostnotification and Currentnotification properties of the HttpContext object can be used when providing handlers for HttpApplication events.

The Headers and ServerVariables properties of the HttpRequest object, which support write functionality.

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.