Editorials

Environment Driven Configuration

Environment Driven Configuration

Managing configuration data for multiple environments can be a frequent issue. Many projects have multiple environments allowing different efforts to execute simultaneously. Often, configuration information such as data connections differs for each environment to provide segregation. You might have environments for Test, Development, Production, Training, Stress, Sales, etc.

Today I was introduced to SlowCheetah by a colleague, Matt. SlowCheetah is a visual studio extension allowing you to align configuration settings with different build configurations. By default, visual studio has two configurations for Debug and Release. However, you can alter the configurations with entries that make sense to you.

SlowCheetah extends the visual studio experience in two ways. It allows you to create configuration settings for each configuration defined in your project through the solution explorer. Using the interface allows you to maintain individual configuration (app.config) settings for each build configuration. It utilizes XSLT to transform entries from the configuration specific version of your app.config or web.config, and introduce, based on your XSLT rules, the differences into a config file for you app.

The second thing it does is to perform the transformation for you automatically when you build the software. Selecting a configuration results in merging the appropriate configuration version of your config file, and deploying it in place of the app/web.config file. It also does this by pressing F5 to run your application.

SlowCheetah is even more useful when performing automated builds using tools such as TeamCity because it is aligned with the appropriate build configuration, and therefore, you don’t have to manage different configuration file deployment for each build; it’s all in one place in the master solution, modifying the app/web config file according to the build configuration. Now you don’t have different files for different environments…it’s all in version control in the master solution for all environments, and swapped out magically as the environment demands.

As I understand it, the current version of SlowCheetah will also transform other files that are not necessarily configuration files. I haven’t really looked into that part myself. You’ll probably want to wash up on document transformation syntax.

Here are a couple links for you to get more information, and even download the extension.

Scott Hanselman’s blog

Visual Studio Extension Gallery

Do you have a configuration management method you prefer? Share with us through email to btaylor@sswug.org, or leave a comment online.

Cheers,

Ben