May 14, 2007

Single config file - multiple deployment environments (i.e. dev, qa, prod)

A common problem most application developers face at one time or another is managing the deployment of the environment specific configuration elements their application depends on.  Most often these elements include items like connection strings, file paths or other settings the application requires access to during runtime.  I recently tackled this problem and came up with a solution that seems to work pretty well (we have been using it for the past 4 months without any issues) and fits in great with our automated build enviornment.  Download code (http://mattberseth.com/downloads/managing_environment_config_settings.zip) for this article. My approach was pretty simple.  I wanted the build process to substitute all of the environment specific config settings while it was making the build.  So if I was doing a regular build at my desk, Visual Studio would automatically use the 'dev' environment settings, but when the automated build server did a 'qa' or 'prod' build, the correct settings would be applied here as well.  1.  First I identified...

Topics: Build


Consulting Services

Yep - I also offer consulting services. And heck, I'll do just about anything. If you enjoy my blog just drop me an email describing the work you need done.

Recent Comments

  • TimothyP wrote: I work with tons of developers who haven't even got a clue what Twitter of Facebook is. In fact, it'...
  • Janko wrote: Yes it's strange that people think it's ok to blog at work but consider unethical to use facebook. P...
  • Kam Lagan wrote: Hi Matt, The numbers do seem a little "off" to what you perceived the community would be like. But...
  • Siderite wrote: You're kidding me! So the people that don't blog think it is ok to blog at work (maybe because they ...
  • Guy Harwood wrote: Good to see the results. one typo.... 'What best describes your current job title?' appears twice,...
  • sirrocco wrote: One problem with : DEV I DEV II DEV III was that I didn't know what it meant :( .(is it common ...
  • Jack wrote: How many person fill the survery? Blog is very common, so I don't think 71.5% is high. Maybe our bos...
  • Andy wrote: Done. The developer1, developer2 question - not sure how meaningful the results are going to be for ...