Environmental overrides that switch depending on host name

Topics: Developer Forum
Jul 11, 2006 at 4:00 PM
How about an update to the environmental overrides block that switches on the host name of the machine.

Depending on what host your on the block would pick the right configuration sections or file and load them.

This would ease deployment in a multi server development/staging/production environment.

Jul 11, 2006 at 11:35 PM
Sounds reasonable and I have thought about this sort of behaviour before. The reason I didn't add this sort of behaviour was because of:

1. It would require my code to choose a configuration file runtime, also my code should somehow be called before the configuration file is being accessed.

The code I write in this tool is designtime only.

2. The deployment scenario I currently have in mind for environmental overrides is that a buildserver creating a msi (or the msi itself, based on commandline arguments) decides wich .config file to deploy. In a Nant script it would be trivial to copy one .config file over another.

I realize creating msi's or nant files is quite an overhead for smaller projects, in which case a batch file might do the trick.

If I am missing options that do not require me to write runtime code or missing something else, please let me know.

Jul 12, 2006 at 8:47 PM
Thats a good reason.

I will continue down the path of msi.

Thanks for the quick reply.