O'Reilly logo

Programming Visual Basic .NET by Dave Grundgeiger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuration

System and application configuration is managed by XML files with a .config extension. Configuration files exist at both the machine and application level. There is a single machine-level configuration file, located at runtime_install_path \CONFIG\machine.config. For example, C:\WINNT\Microsoft.NET\Framework\v1.0.2914\CONFIG\machine.config. Application-configuration files are optional. When they exist, they reside in the application’s root folder and are named application_file_name .config. For example, myApplication.exe.config. Web application-configuration files are always named web.config. They can exist in the web application’s root folder and in subfolders of the application. Settings in subfolders’ configuration files apply only to pages retrieved from the same folder and its child folders and override settings from configuration files in higher-level folders.

Configuration files should be used for all application-configuration information; the Windows Registry should no longer be used for application settings.

Configuration File Format

Configuration files are XML documents, where the root element is <configuration> . For example:

<?xml version="1.0" encoding="UTF-8"?>

<configuration>
   <!-- More stuff goes in here. -->
</configuration>

To be as flexible as possible, .NET configuration files use a scheme in which the application developer can decide on the names of the subelements within the <configuration> element. This is done using the <configSections> ,

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required