Avatar of rgn2121
rgn2121Flag for United States of America

asked on 

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
ProgrammingVersion ControlEditors IDEs.NET ProgrammingWeb Languages and Standards

Avatar of undefined
Last Comment
rgn2121
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of rgn2121
rgn2121
Flag of United States of America image

ASKER

Is this something that you developed internally?
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

No, that is something that our company uses.  I was just thinking that you might be able to replicate that behavior.
Avatar of rgn2121
rgn2121
Flag of United States of America image

ASKER

The web site migrator detects the target environment

Do you know how this is done...?  Is it by a server name or IP address?
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

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.
Avatar of rgn2121
rgn2121
Flag of United States of America image

ASKER

okay...thanks for the input!  Not sure exactly what we will do yet, just trying to get ideas.
Avatar of rgn2121
rgn2121
Flag of United States of America image

ASKER

Thanks
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo