Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 441
  • Last Modified:

Help with managing config files for multiple environments...

I am on an application team that currently has 7 environments other than the production environment.  We have 4 config files that we always have to change any tiem we install in a different environment.  I am curious the best way to go about this...

Ideally we would like to NOT have to do a build for each environment which is what it seems this link discusses:
http://weblogs.asp.net/scottgu/archive/2007/09/21/tip-trick-automating-dev-qa-staging-and-production-web-config-settings-with-vs-2005.aspx

I thought about something more along this line, but not sure that is the best bet either...
http://blog.andreloker.de/post/2008/06/Keep-your-config-clean-with-external-config-files.aspx

Maybe you should always build for each environment?  Not sure if there is a way to do one build and then based on the environment the correct file loads?  Maybe by the server name it is on?

Any help or direction would be appreciated.  Right now we have a file for each of our 3 services and the web.config and when we install we go in and comment/uncomment sections...

thanks,
rgn
0
rgn2121
Asked:
rgn2121
  • 4
  • 3
1 Solution
 
Bob LearnedCommented:
There might be an idea in the web site migrator that we use.  We create a web.config for the development environment, and a test.web.config file for the test environment, and a production.web.config for the production environment.  

The web site migrator detects the target environment, and copies the test.web.config over the web.config file, and deletes the test.web.config file.  The migrator has 3 steps:  copy files to a folder on the server, migrate from development to test, and then an external team migrates from test to production (SOX compliance).
0
 
rgn2121Author Commented:
Is this something that you developed internally?
0
 
Bob LearnedCommented:
No, that is something that our company uses.  I was just thinking that you might be able to replicate that behavior.
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
rgn2121Author Commented:
The web site migrator detects the target environment

Do you know how this is done...?  Is it by a server name or IP address?
0
 
Bob LearnedCommented:
The migrator has different options for the migration process:  Development -> Test, Test -> Model, Model -> Production, so that it know which environment to use.  

An environment detector could have a list of host names and/or IP addresses, so the web site could determine the current environment, and use the correct web.config file.  You could use a "base" web.config, that has all the common settings, and an environment-specific version (i.e. database connection strings), that you would copy during the deployment.
0
 
rgn2121Author Commented:
okay...thanks for the input!  Not sure exactly what we will do yet, just trying to get ideas.
0
 
rgn2121Author Commented:
Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now