We have several .NET projects where we store certain settings in config files. Now each developer will have their own config files that differ a little (different connection strings to connect to local db, different WCF endpoints etc.)
At the moment we tend to check out app/web.config files and modify them to suit our needs. This leads to many problems since from time to time someone will check in their own settings or loose custom config when getting latest version from tfs.
My question is: how do you deal with situations like this? Or you don't have this problem at all?
One way you could cope is to have a tokenised system and use a rake script to change the values.
A more rudimentary method could be to have a link to an AppSettings.config file for all AppSettings in your web.config (similar with connections) i.e.
Then have a folder with each of your developers have a version in a sub folder (i.e. /_configs/dave/). Then when a developer is working on their own code they copy from the sub folder to the root of the linked folder.
You will need to make sure you communicate changes to these files (unless you tokenise). If you keep the AppSettings.config file out of source control and only check in the devs individual folders (all of them) then they will be forced to copy the correct one.
I prefer tokenisation but can be tougher to get up and running if this is only meant to be a quick fix.
We have the same problem and what we are doing is
How about ignoring the file, so it never gets checked in? I've run into a similar issue and have added web.config to the ignore list in Subversion.
In TFS though, it's a little bit harder, see this post on how to do it.
We are using machine.config to avoid having differences in web.config between the environments.
Assuming you are using Visual Studio, why don't you use different Solution Configurations? For example: you can have a Debug config which uses Web.config.debug and a Release config which uses Web.config.release. Web.config.debug should have something like
with the file Standard_Name_For_Config.config that gots all the personal developer settings, while the Web.config.release always has the production settings. You can store default configs in some source controlled folder and make a new user take them from there.
Ignore the files and have a Commom_Web.Config and Common_App.Config. Using a continuous integration build server with build tasks which rename these two to normal names so that the build server can do its job.