Share via


IIS Settings for ASP.NET Applications

ASP.NET applications are hosted on Internet Information Services (IIS) Web sites, while settings in Web.config configuration files control behavior for these applications. These Web.config settings override those in a computer's Machine.config file. In addition, some Web.config settings include IIS settings that are specified in the IIS metabase. You can edit this metabase using the Microsoft Management Console (MMC) snap-in, called IIS Manager.

Previously, you needed to configure the Web.config settings and IIS settings separately for an ASP.NET application. However, you can now configure both groups of settings using the Settings and Constraints Editor in Visual Studio Team System Architecture Edition. This topic explains how to map these settings from the Settings and Constraints Editor to their counterparts in the IIS metabase and Web.config.

The following sections contain more information about finding these settings:

  • Settings and Constraints Editor and IIS Manager

  • IIS Settings in Settings and Constraints Editor and IIS Manager

  • Configuration File Settings in Settings and Constraints Editor and IIS Manager

For more information, see Settings and Constraints Editor and the IIS documentation at https://go.microsoft.com/fwlink/?linkid=54804.

Settings and Constraints Editor and IIS Manager

In Application Designer, you can configure or import IIS settings for an ASP.NET application. In IIS Manager, Web applications reside under Web sites. When you deploy an ASP.NET application to a Web site, an IIS Web application (or a virtual directory for the application) is created. This virtual directory has settings that control ASP.NET application configuration, for example, authentication requirements for that application. These virtual directory settings override the default settings of the Web site.

You can also import settings from a deployed Web application (or virtual directory). This obtains a complete and correct configuration of that application. For more information, see How to: Import ASP.NET Settings from an IIS Server. In System Designer, you can also override these settings to create different application configurations for system deployment. The deployment report generated for these systems will contain these settings for scripting deployment. For more information, see Overview of Deployment Reports and Overview of Deployment Using Deployment Reports.

You can locate these settings in IIS Manager when you need to configure or validate these settings for deployment.

The following illustration shows an ASP.NET application in Application Designer, ASP.NET application files in Solution Explorer, the Settings and Constraints Editor, and IIS Manager.

Settings and Constraints Editor and IIS Manager

ASP.NET Application Settings in IIS Manager

IIS Settings in Settings and Constraints Editor and IIS Manager

In Application Designer, you can view the settings for an ASP.NET application by selecting it on the application diagram and opening the Settings and Constraints Editor. In this editor, you can find these settings in the Application Settings folder. Under the Directory resource, select the WebApplication resource to view the IIS settings required by an ASP.NET application.

Note

The combination of the WebApplication and Configuration resources comprise the complete configuration of host environment and application settings for the ASP.NET application. For more information about the Configuration resource, see Configuration File Settings in Settings and Constraints Editor and IIS Manager.

In IIS Manager, you can view these settings on the appropriate Web server under the Web Sites node. Under the Default Web Site node, select the application node.

The following illustration shows the WebApplication resource in the Settings and Constraints Editor and the corresponding application node in IIS Manager.

IIS configuration for an ASP.NET application in Settings and Constraints Editor and in IIS Manager

IIS Settings for ASP.NET Applications

The settings pane in the Settings and Constraints Editor displays settings for each resource. You can find many of these settings in IIS Manager when you open the Properties dialog box from the corresponding node.

Note

Some setting names, values, or types differ from their IIS metabase counterparts and might require translation. For more information, see Setting Names that Differ from the IIS Metabase and Setting Types that Differ from the IIS Metabase.

The following illustration shows the settings pane in the Settings and Constraints Editor and the Properties dialog box in IIS Manager. The Properties dialog box displays different properties for each node in IIS Manager.

Settings pane in the Settings and Constraints Editor and IIS Manager Properties dialog box

Settings Pane and IIS Properties Dialog Box

Configuration File Settings in Settings and Constraints Editor and IIS Manager

In the Settings and Constraints Editor, you can view the configuration file (Web.config) settings for an ASP.NET application in the Application Settings folder. Under the Directory resource, select the Configuration resource to find these settings, which are organized as resources. You can find these settings and resources within the <configuration> element of the application's Web.config file.

In IIS Manager, you can view these settings on the appropriate Web server under the Web Sites node. Under the Default Web Site node, select the application node and then the Web.config file in the right pane.

Note

The settings in the Web.config file reflect their configuration in the development environment. You need to update these settings at deployment using the deployment report. For more information, see Overview of Deployment Using Deployment Reports.

The following illustration shows the Configuration resource in the Settings and Constraints Editor and the corresponding node in IIS Manager.

Configuration file settings in Settings and Constraints Editor and IIS Manager

ASP.NET Application Configuration File Settings

For example, suppose an ASP.NET application requires "Passport" authentication. You can configure this requirement using the Settings and Constraints Editor. In the Application Settings folder and under the Directory resource, locate the Configuration resource, then the SystemWebSectionGroup resource, and select the AuthenticationSection resource. In the settings pane, find the Mode setting under the Settings node. This value appears within the <system.web> element of the application's Web.config file as follows:

<configuration>
   ...
   <system.web>
      <authentication mode="Passport" />
      ...
   <system.web>
</configuration>

In IIS Manager, you can find the corresponding setting by expanding the Web Sites node, selecting the application under the Default Web Site node, and then viewing the properties of the Web.config file. In the Web.config Properties dialog box, click Edit Configuration on the ASP.NET tab, which opens the ASP.NET Configuration Settings dialog box; view the Authentication tab. On this tab, this value appears in the Authentication mode box.

See Also

Reference

IIS Settings for IIS Web Servers

Settings and Constraints Editor Terminology