Click here to Skip to main content
13,052,558 members (57,672 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


4 bookmarked
Posted 13 Sep 2010

Per developer configuration files (Visual Studio)

, 13 Sep 2010
Rate this:
Please Sign up or sign in to vote.
Per developer configuration files (Visual Studio)

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 ( in all our .NET projects (Visual Studio 2005), basically:

  1. Genuine configuration files (such as web.config in an ASP.NET project) are moved as templates in a subfolder
  2. Hard coded values must be replaced with ${your_property} properties
  3. Genuine configuration files must be ignored in your source control server
  4. Each developer should create his property file (whose name must include at least the current Windows username), with customized values for ${your_property} properties
  5. 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)
  6. 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.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Florian DREVET
Other euroCSgroup - Cabinet Zulian ICS
France France
I'm 30 year old, living at Saint-Maurice-de-Gourdans (France, near Lyon)

Research and Development manager

My hobbies are motorcycle (I'm riding a GSXF 750), Formula One, diescast Formula One models (mainly 1/18 scale), gardening, video games, and... software developement.

I started to make softwares about 15 years ago as a hobby, including now about 11 years of profesional activity. I worked for :
- a web agency
- a medical ISV (Independent Software Vendor), mainly in blood tracability department
- an online computer components seller
- actually in an engineering (and scientific advisory) ISV

I acquired several but complementary skills during this time, mainly (but not only) on Microsoft's technologies and platforms : assembly (x86, 68k), C, C++, C#, JavaScript, PHP, DBMS (MySQL, Oracle, SQL Server, etc.), etc.

Since 2007, I'm particulary active on .NET, ASP.NET, C#, SQL Server and ORM (NHibernate) with a growing time spent on architecture, technical managment, code review, etc.

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 13 Sep 2010
Article Copyright 2010 by Florian DREVET
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid