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.
You could alter the main *.config file (e.g. web.config or app.config) by adding configuration sections
I am using log4net, Active Record and Ciphersafe in one of my web application and in my web.config I have
Then I have configuration section for each, e.g. for log4net I have
That way I have only 1 web.config file. Then I created a seperate Project in my solution name ProjectFiles which contains all my external assemblies and config files. Then when I make a request of updating my solution to the operations side I copy the relevant config file (test or prod) with the web application files