Environments practical usage

Topics: Enterprise Library Core, General discussion
Apr 23, 2007 at 4:04 PM
Hi, I am very interested in Environmental overrides, it seems it provides the functionality I am after.
However I have difficulties understanding how I should practically use it.
For example, if my app.config get some environmental overrides, then delta files get generated, which I include in my project's setup files.
Then I want the setup to ask which environment the user wants to install in, and that it calls the command line utility to merge the files together and generate my <application_name>.config file.
The problem is, my app.config file already gets renamed into <application_name>.config and if I try to merge it into itself, it doesn't work.
Does anyone have a real life example of how to use the environmental overrides with a setup program ?
Any help (pointers etc) would be greatly appreciated.
Apr 23, 2007 at 5:16 PM
I wouldn't recommend doing the merging during setup. The configuration merging is designed to be a design-time process; at runtime the application only knows about a single merged configuration file. If you want to build a single setup application that works in multiple environments, I'd suggest packaging all of the merged config files into the installer and have it install just one of them based on the user's selected environment.