Configuration files (such as app.config, web.config, etc.) are very convenient, but it's a real pain to manage them in a collaborative environment.
Although Microsoft introduced web.config transforms in Visual Studio 2010, it suffers (stop me if I'm wrong) from several limitations:
In my case (a team with a dozen of .NET developers on several ASP.NET projects, with Visual Studio 2005 and SVN as source control) which is probably next to yours, each developer was changing his configuration files with his own values (connection string, debug mode, etc.) and was periodically committing his changes, making other developers lose their values or have conflicts while updating (XML is badly merged with SVN).
I solved this problem by using NANT (http://nant.sourceforge.net) in all our .NET projects (Visual Studio 2005), basically:
- Genuine configuration files (such as web.config in an ASP.NET project) are moved as templates in a subfolder
- Hard coded values must be replaced with ${your_property} properties
- Genuine configuration files must be ignored in your source control server
- Each developer should create his property file (whose name must include at least the current Windows username), with customized values for ${your_property} properties
- A NANT's build file must be created, it's aim is to load the current Windows username property file, then copy the templated configuration files to their genuine place (properties must be extended)
- NANT must be triggered during the Visual Studio's pre-build event, to execute the build file
That's all folk, now each developer can manage his own property file (which can be/must be stored in your source control server) independently of the machine he's logged (as long as the Windows username is the same of course!).
Depending on your needs, you can extend this principle with the machine name, the current configuration, etc.
You can contact me if you want further information.