IIS 7.0 integration mode and Classic Mode

Source: Internet
Author: User
Tags configuration settings

Web applications in iis7.0ProgramThere are two configuration modes: Classic mode and integration mode. The classic mode is to be compatible with previous versions, and ISAPI extensions are used to call ASP. net Runtime Library, the Web application originally running under iis6.0 is migrated to iis7.0, as long as the application is configured to the classic mode,CodeIt can run normally without modification. The integration mode is a unified request processing pipeline, which combines ASP. the net request pipeline is combined with the IIS core pipeline. This mode provides better performance, implements configuration and management modularization, and increases the flexibility when using the managed code module to expand IIS. If the old web application runs in iis7.0 integration mode, you may need to modify the Web. config file of the application, especially when you use a custom module that implements the ihttphandler interface. Iis7.0 supports two modes of applications on the same server at the same time.

ASP. net MMC snap-in is used to configure ASP. net, 7.0 in ASP. NET application management domain IIS management is more closely integrated, there is no separate management unit, all IIS and ASP. net configuration is completed using the IIS manager. Iis7.0 configuration information is based on.. NET Framework Configuration System. the config file contains both the Web server and ASP. net configuration settings, such as web. set the extension and file ing in the config file (iis6.0 must be configured in IIS ).

 

Changes in the web. config file

The system. webserver section specifies the iis7.0 settings applied to Web applications. Its parent node is configuration. The content that can be set on this node includes:

    • The default document (defaultdocument) returned by the Web server to the client when the request does not contain the specified resource );
    • Response compression settings (httpcompression)
    • Custom header (customheaders in the httpprotocol Section)
    • Module)
    • Handlers)

Some of these settings apply only to the integration mode, but not to the classic mode. For example, applications running in the Classic Mode ignore the web. config system. all the managed code modules and handlers specified in the webserver section. In this mode, web applications should be. define modules and processing programs in httpmodules and httphandlers of the web section.

 

Migrate web applications to the integration mode

Web applications that do not contain custom modules or processing programs normally work in IIS 7.0 integration mode without changes. For Web applications that depend on custom modules or handlers, 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 integration mode section and register the custom module and handler in the system. webserver section of the web. config file.

    • Only the event handlers for HTTP application request pipeline events (such as beginrequest and endrequest) are defined in the init method of the custom module.

    • Make sure that you have fixed upgrading ASP. net Applications to IIS 7.0: differences between IIS 7.0 integrated mode and classic mode (set ASP. NET application to IIS 7.0: the difference between IIS 7.0 integration mode and Classic Mode) the issues discussed in the "known differences between integrated mode and classic mode" section (known differences between the integration mode and the classic mode.

Modules that implement the ihttpmodule interface are called managed code modules because they are generated using. NET Framework. You can register a managed code module at the server or application level. The local code module is a DLL (unmanaged code) registered only at the server level ). In integration mode, core ASP. NET functions, such as session Status and forms authentication, are implemented in the form of a hosting module.

When migrating an application from the classic mode to the integration mode, you can retain the custom module and Handler Registration in the Classic mode, or remove these registration. If you do not remove the httpmodules and httphandlers registration used in Classic mode, you must set the validateintegratedmodeconfiguration attribute 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 "disabling the migration message" in ASP. NET integration with IIS 7.0 (Integrating ASP. NET with IIS 7.0.

 

Migrate the Web. config file for use in integration mode

If the module or handler is defined at the application level, the module or handler is not automatically called. This involves a module or handler that meets the following conditions: defined in a program set in the bin folder;Source codeIs not registered and defined in the system. webserver section of the web. config file. To enable a module or handler to participate in the integration mode request pipeline, you must register the module or handler using one of the following methods:

    • Directly edit the Web. config file and add the modules or handlers element to the system. webserver element. Note that the element names are different from those in Classic Mode: modules and handlers correspond to httpmodules and httphandlers in Classic Mode respectively.

    • Use the IIS manager to configure the module or handler. For more information, see logging ing handler mappings in IIS 7.0 (configuring handler ing in IIS 7.0) and logging ing modules in IIS 7.0 (configuring the module 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 (use appcmd.exe to configure site, application, virtual directory, or URL settings ).

Use the classes and attributes of the integration mode

When using applications in IIS 7.0 integration mode and. NET Framework 3.0 or later, you can use the following classes and members that are unavailable in Classic Mode:

    • The substatuscode attribute of the httpresponse object, which can be used to set useful code when a failed request trace is configured. For more information, see troubleshooting failed requests using failed request tracing in IIS 7.0 (use the tracking function in IIS 7.0 to solve the request failure problem ).

    • The headers attribute of the httpresponse object, which can be used to access the response header.

    • The ispostnotification and currentnotification attributes of the httpcontext object can be used when handling the httpapplication event.

    • The headers and servervariables attributes of the httprequest object. They support the write function.

IIS 7.0 download (Microsoft Web Server Component IIS 7.0): http://download.microsoft.com/download/1/0/d/10da04bb-4e82-485a-abb3-94feff40a7b3/NETShow56_300.EXE

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.