Chapter 37Configuration Files

Wrox.com Code Downloads for this Chapter

The wrox.com code downloads for this chapter are found at www.wrox.com/go/professionalvisualstudio2015 on the Download Code tab. The code and any related support files are located in their own folder for this chapter.

One of the challenges to build applications is adjusting the way the application functions on-the-fly without having to rebuild it. There's a long history of applications using configuration files to control the way an application runs. .NET applications use a series of XML configuration files that can be adjusted to determine application behavior. This chapter explores the structure of these configuration files and demonstrates how you can store custom information using a configuration section handler.

.Config Files

The .NET Framework configuration system consists of several configuration files (discussed in the following 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. This model is such that sections defined in a configuration file at a lower level override the same sections specified in a file higher up the chain. If no configuration file defines a value or section, the ...

Get Professional Visual Studio 2015 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.