Management of websites via configuration files

Web Configuration file hierarchy

Configuration files allow management of settings related to website, e.g. security info, database connection strings, cache settings, etc.

Site may use multiple configuration files, based on a hierarchy.

location file
Global config %SystemRoot%\Microsoft.NET Framework\version\CONFIG\Machine.config
Root web config   %SystemRoot%\Microsoft.NET Framework\version\CONFIG\Web.config
Website www root\Web.config
Web application www root\web ap\Web.config
Folder www root\web app\dir\Web.config


When initially run ASP.NET application the runtime environment builds a cache of configuration settings by flattening the layers of configuration files.

.NET 4 Configuration Files

Previous versions of .NET used same configuration file. As framework evolved the configuration file has got longer and more unwieldy.

.NET 4 has new CLR and a new Machine.config file that includes many of the settings previously added to individual Web.config files - makes them much shorter.

Editing Configuration Files

Can use any text editor.

Visual Studio 2010 provides Web Site Administration Tool (WSAT) that can modify configuration file settings in following categories:

WSAT allows creation and modification of settings that are not inherited. Inherited settings that cannot be overridden are unavailable.

IIS 7.5 Manager allows editing of many common ASP.NET configuration settings.