We port the ASP. NET program from IIS6 to IIS7, and the following error may occur:
Why are the above errors?
The IIS7 application pool has two modes: "integration mode" and "Classic mode ".
Classic mode is the way we used to use IIS 6.
If you use the integration mode, you need to modify the configuration file for the custom httpModules and httpHandlers and transfer them to the <modules> and
Two solutions:
Method 1: configure the application pool
Configure the application pool on IIS7 and change the mode of the application pool to "classic". Then everything works normally.
Enter the error message prompted above in the search engine, and almost all the searched results are directly changed to "classic.
However, this is only a matter of expediency. IIS7.x is used, but only six functions are used. In addition, some ASP. net mvc programs do not work well. Therefore, we try the following solutions:
Method 2: Modify the web. config configuration file:
For example, the original settings (You may not have the httpModules or httpHandlers node in your environment)
<system.web> ............
When the IIS7 application pool is "integration mode", change:
<system.web> ...........</system.web><system.webServer> <modules> <add name="MyModule" type="MyApp.MyModule" /> </modules>
(If your web. config does not have an httpModules or httpHandlers node, add the following directly to the node system. webServer:
<Validation validateIntegratedModeConfiguration = "false"/>
In this way, the integration mode cannot be verified to avoid error prompts.
Classic mode VS Integrated mode
Classic ModeIIS uses the ISAPI extension (ISAPI extension aspnet_isapi.dll) and ISAPI filter (ISAPI filter aspnet_filter.dll) to call the ASP. NET Runtime Library to process requests. If the Classic mode is used, the server uses two pipelines to process the request. One is responsible for the source code and the other is responsible for hosting the code. In this mode, applications cannot fully use the services provided by IIS7.X.
Integration ModeIs a unified request processing pipeline, which combines the ASP. NET Request pipeline with the IIS core pipeline. In integration mode, ASP. NET enters the IIS core from the role of the IIS plug-in (IIS extension) to monitor each request and operation. In integration mode, ASP. NET can run in IIS more effectively and effectively improve the website performance. Some codes developed in IIS6 need to run in the Classic mode, because an error message occurs in the integration mode. To use the services provided by IIS7 more effectively, we recommend that you put the website in integrated mode and solve the problem according to the error message.
For more principles, please share your comments!