IIS7 Deployment Error 500.22 errors check the ASP. NET configuration that is not used in this integrated managed mode

Source: Internet
Author: User

2014-08-08

A company project, the environment is:. Net 4.0 + MVC3, deployed on Windows Server 2003R2 IIS6.0.

Migrating to a new server in Windows Server 2008R2, deployed on IIS7.0, in the application pool, in managed pipeline mode, the "Integrated" mode is selected, such as:

Other configurations are as follows:

After the configuration is complete, access error errors,

Finally, the reason is checked: the Web. config profile in this project is not suitable for IIS7.0.

The pipeline mode of the application pool is then selected as "classic" mode

Again access everything is OK.

The root cause of the problem is that the IIS7.0 mechanism has changed, no longer the same as II6, but compatible with IIS6.0.

IIS 7.0 has made some modifications to the configuration files that Web developers can use to modify the content. For example, the,<system.webserver> section is such a modification,

Both Classic mode and integrated mode recognize the <system.webServer> section while,<system.webserver> Sections can be set in either the ApplicationHost.config file or in the Web. config file.

The <system.webServer> section can control both static and dynamic pages. Even in Classic mode, the,<system.webserver> section also plays an important role in helping Web developers set up different IIS configurations in the. config file.

In integrated mode, HTTP modules and HTTP handlers are no longer defined in <system.web>, but are defined in <system.webServer>. If you run a Web. config file that includes an HTTP module or an HTTP handler in Integrated mode, the invalidation will occur. Fortunately, Microsoft has detailed a 500.22 error message that explains how to migrate the Web. config file step-by-step.

With the AppCmd.exe tool, you can easily complete the migration of your files. In order to migrate the Web. config file on the default Web site, you can execute the following AppCmd.exe command:

    1. AppCmd.exe migrate config "Default Web site/"

The following is an example of a Web. config file, which works in the Classic mode of IIS 6.0:

  1. <? XML version= "1.0" encoding="Utf-8" ?>
  2. <configuration>
  3. <system.web>
  4. <httpmodules>
  5. <add type="classname, AssemblyName"
  6. Name="modulename" />
  7. </httpmodules>
  8. </system.web>
  9. </configuration>

After the AppCmd.exe migrate config command finishes running, the Web. config file is updated to the following:

  1. <? XML version= "1.0" encoding="Utf-8" ?>
  2. <configuration>
  3. <system.web>
  4. <httpmodules>
  5. <add type= "classname,
  6. AssemblyName " name="modulename " />
  7. </httpmodules>
  8. </system.web>
  9. <system.webserver>
  10. <modules>
  11. <add name="modulename"
  12. Type="classname, AssemblyName"
  13. precondition="Managedhandler" />
  14. </Modules>
  15. <validation
  16. validateintegratedmodeconfiguration="false" />
  17. </system.webserver>
  18. </configuration>

Note that the httpmodules section is still retained in the Web. config file for backwards compatibility, but in system.webserver, the Modules section takes precedence.

The Validateintegratedmode configuration property ensures that IIS does not cause problems due to the existence of a legacy

The integrated pipeline mode is the default pipe mode and has some important advantages. All we need to do is migrate all the Web. config files that define the HTTP handlers and HTTP modules to ensure that they work properly under IIS 7.0.

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.