views:

68

answers:

5

I'm wondering how other developers are handling source code conflicts for config files when system admins modify them in production. For example, if a system admin updates a appsettings key on the production server and then my team publishes out a project, it will overwrite that key.

How do you handle config file updates in your organization?

+1  A: 

We don't let sys-admin take control of the web.config. It shouldn't ever be allowed. Only a build manager or a team-lead should have access to actual production web.config. What purpose do you see for a sys-admin to access the web.config ?

this. __curious_geek
We build a lot of business tools for our admins to use. It would be nice to let them configure it as they need so we don't have to do it for them. Things like connection strings, ldap paths, etc.
mcass20
If the problem is actually in configuration per environment, you might want to look into create a dedicated config for each environment. It will save you time and headaches when one key forgets to get changed or is manually changed incorrectly.
joseph.ferris
The multiple config file solution sounds promising. I hope that VS2010 facilitates that.
mcass20
I have been doing it in the fashion of Scott Hanselman's blog article for a while now. It should work with all versions of VS.NET, too. :-) http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx
joseph.ferris
+3  A: 

Personally I use machine.config file and never store any environment related setting in app/web.config. This allows me to deploy the exact same application on all environments.

Darin Dimitrov
A: 

In my opinion, this is a sign of the process flow breaking down.

The only time that a production file should be changed is if it is critical (performance, critical to business needs, etc). Other than that, everything should go through a predefined flow. The process is bigger and more important than any member in it - including admins.

Part of that flow is that the most recent version in version control is the "definitive copy". Changes applied to production should also be made to a version in SC. Preferably, the SC version should be changed so that uncontrolled files are not floating around.

joseph.ferris
A: 

If admins need to change an AppSetting, then I would move that value to a database table instead and give them a UI to modify it. As everyone else has said, the config files should be stored in source control.

David
+1  A: 

I think my answer is it depends. Perhaps it is a non-critical application and it was designed with some parameters that need to be changed from time to time. Instead of creating a database with a table and a GUI interface for a couple of parameter changes or have an external text file or xml file, train the admins to open the web.config and change an appsetting parameter. As long as there is some way to manage the process, I can perhaps see a use for this.

RJ