web analytics

An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode

Options

codeling 1599 - 6654
@2016-01-11 12:45:29

On IIS 7.0, ASP.NET is configured to operate in the new Integrated mode by default. If you install your existing ASP.NET application which is built on IIS 6.0 on an ISS 7.0 machine, When you try to start the application, the following error will be displayed:

HTTP Error 500.23 - Internal Server Error

An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

The reason is that the ASP.NET integration to IIS have been changed on IIS 7.0. By default ASP.NET is configured to operate in the new Integrated mode on IIS 7.0, see this posting for more detail about the ASP.NET and IIS architecture.

There are two ways to fix this issue.

The first one is using "Classic" ASP.NET modes. when you install your ASP.NET application on the IIS 7.0 machine, you have to choose the "Classic" ASP.NET modes to be used in your application.

 

IIS 7.0 continues to provide the "Classic" ASP.NET mode for ASP.NET applications that have specific compatibility requirements not met by the Integrated mode.

The second way is to enable your application to take advantage of Integrated mode enhancements with minimal modifications. The following sections explains how to migratie ASP.NET Applications to IIS 7.0 Integrated mode.

Migrating ASP.NET Applications to IIS 7.0 Integrated mode

Because of the configuration unification, some applications may require migration in order to operate property in Integrated mode. By default, the server provides assistance with migration. It detects applications that require migration, and returns an error message requesting the application be migrated.

The following configuration causes the migration error:

  1. The application web.config file defines <httpModules> configuration.
    The application loads new ASP.NET modules, or removes existing ones.
    In Integrated mode, ASP.NET modules are specified together with native modules in the unified <system.webServer>/<modules> configuration section.
    The ASP.NET modules specified in the <system.web>/<httpModules> configuration section must be moved to the new configuration section in order to take effect. Subsequently, new ASP.NET modules must be added directly to the unified <modules> section.
  2. The application web.config file defines <httpHandlers> configuration.
    The application uses custom handler mappings for some content types.
    In Integrated mode, the ASP.NET handler mappings must be specified in the unified <system.webServer>/<handlers> configuration section in order to take effect. Subsequently, new ASP.NET handler mappings must be added directly to the unified <handlers> section.
    The section replaces both the ASP.NET <httpHandlers> configuration AND the IIS 7.0 scriptmaps configuration, both of which previously had to be configured in order to set up an ASP.NET handler mapping.
  3. The application web.config file defines <identity impersonate="true" /> configuration.
    The application impersonates client credentials (most common with intranet applications). In Integrated mode, client impersonation is not available in some early request processing stages. In the majority of cases, this is not a problem and you can turn off the error – otherwise, you must configure this application to run using the Classic ASP.NET mode.

Migrating the Application Configuration

IIS 7.0 takes care of migrating the application by using the APPCMD.EXE command line tool to perform the migration. The migration error message contains the command that is executed in command line window (which you must run--right click the Programs\Accessories\Command Prompt icon, and choose "Run as administrator") in order to instantly migrate your application to Integrated mode.

The basic format of the migration command is the following:

%windir%\system32\inetsrv\APPCMD.EXE migrate config <Application Path>

Where <Application Path> is the virtual path of the application containing the site name, such as "Default Web Site/app1".

When migration is complete, your application runs in both Integrated and Classic modes without a problem.

Note: If you change the configuration after migration, the server will not prompt you to migrate again. After initial migration, you must make sure that your configuration remains in sync between the two modes – manually migrate the application again using the APPCMD.EXE command line tool.

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com