Partager via


How to: Suppress IIS 7.0 Registration Warnings

The validation element controls whether Internet Information Services (IIS) checks that the Web application's Web.config is correctly configured for IIS 7.0 Integrated mode. When the validation element's validationConfigurationModeConfiguration attribute is set to true (the default value), a migration warning in Integrated mode is raised when one of the following condition is true:

In some scenarios you might want to suppress the check and the associated warning message. The application's Web.config file can then contain settings for IIS 6.0 and for IIS 7.0 running in Classic mode. It can also contain settings for IIS 7.0 running in Integrated mode, without having to maintain separate Web.config files.

This topic describes how to suppress the check. For more information about how to move Web applications to IIS 7.0, see Moving an ASP.NET Application from IIS 6.0 to IIS 7.0.

Suppressing the Integrated Mode Warning

When you change an application from using Classic to Integrated mode and you want to leave custom module and handler registrations for Classic mode (and IIS 6.0), you must set the validation element to avoid a warning message.

Note

When you suppress the error message, IIS does not check for unsupported Web.config configurations.

To suppress the integrated mode warning

  1. Open the Web.config file.

    If the application does not have a Web.config file, create one. For more information, see Editing ASP.NET Configuration Files.

  2. If the Web.config file does not already contain a system.webServer section, create one inside the configuration element, as shown in the following example.

    <configuration>
      <system.webServer>
      </system.webServer>
    </configuration>
    
  3. Create a validation element inside the system.webServer element.

  4. Add a validationConfigurationModeConfiguration attribute and set it to false.

    The following example shows a system.webServer section that is configured to suppress IIS migration warning message.

    <configuration>
      <system.webServer>
        <validation validationConfigurationModeConfiguration="false">
      </system.webServer>
    </configuration>
    

See Also

Concepts

Running Web Applications on Windows Vista with IIS 7.0 and Visual Studio

Running Web Applications on Windows Server 2008 with IIS 7.0 and Visual Studio