Reduce number of config files to as few as possible

Posted by Scott on Stack Overflow See other posts from Stack Overflow or by Scott
Published on 2009-11-06T18:24:36Z Indexed on 2010/04/15 2:03 UTC
Read the original article Hit count: 444

For most of my applications I use iBatis.Net for database access/modeling and log4Net for logging. In doing this, I need a number of *.config files for each project. For example, for a simple application I need to have the following *.config files:

  • app.config ([AssemblyName].[Extention].config)
  • [AssemblyName].SqlMap.config
  • [AssemblyName].log4Net.config
  • [AssemblyName].SqlMapProperties.config
  • providers.config

When these applications go from DEV to TEST to PRODUCTION environments, the settings contained in these files change depending on the environment.

When the number of files get compounded by having 5-10 (or more) supporting executables per project, the work load on the infrastructure team (the ones doing the roll-outs to the different environments) gets rather high. We also have a high risk of one of the config files being missed, or a mistype in the config file.

What is the best way to avoid these risks? Should I combine all of the config files into one file? (is that possible with iBatis?) I know that with VisualStudio 2010 they introduce transforms for these config files that allow the developer to setup all the settings for the different environments and then dynamically (depending on the build kicked off) the config files get updated to the correct versions. (VS 2010 - transforms)

Thank you for any help that you can provide.

© Stack Overflow or respective owner

Related posts about configuration-files

Related posts about configuration