38.1. Config Files

The .NET Framework configuration system consists of several configuration files (discussed in the sections) that can be used to adjust one or more applications on a computer system. Part of this system is an inheritance model that ensures that configurations can be applied at the appropriate level.

38.1.1. Machine.Config

At the root of the inheritance model is the machine.config file (located in the systemroot\Microsoft .NET\Framework\versionNumber\CONFIG\ folder), which defines configuration settings for the entire system. All configuration files inherit from this file and can override these settings. It is worth noting that although Visual Studio 2008 ships with version 3.5 of the .NET Framework, it is still based on version 2.0 of the CLR, which means that the configuration files are located in a v2.x.x.x sub-folder.

38.1.2. Web.Config

Web applications are configured via the web.config file. This file can be located in a number of locations, depending on the scope to which the settings need to be applied. To apply a configuration to all web applications on a machine, place the web.config file in the same directory as the machine.config file. In most cases the settings need to be applied at a much finer granularity. As such, the web.config file can also be placed in any virtual directory or subdirectory to control web applications at that level. If it is placed in the root folder for a web site, the configuration will be applied to all ASP.NET applications ...

Get Professional Visual Studio® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.