Search code examples
asp.netdeploymentweb-configweb-deployment-project

Deploying web.config file changes to an existing website


I'm reviewing the way my company deploys websites and trying to determine if we need to update our methods. My particular question is geared towards the way we handle the web.config file. Currently, when we deploy, we do not override the web.config file that's on the server. We manually reproduce whatever changes were made during development. The reason is

1) we do not want to give developers the responsibility of remembering to deploy the right web.config (the production one) to the server during deployment

2) we also don't want to run the risk of anyone on the dev team accidentally changing (or even unnecessarily seeing) the production web.config

3) on some projects, there are other teams that have the power to modify the web.config (like connection string settings) and we don't want to override their changes

I've come across web.config transformations but it seems that our current methods are a better fit for our particular circumstance. I'm hoping for someone to give me a fresh perspective and probably help me see a better way if there indeed is one.


Solution

  • In a team of developers (i.e. UI designers, programmers, SQL developers), your strategy seems pretty right but it needs accurate co-ordination. The other way you can go is to tell all your departments about various parts of the web.config and the part which they are concerned with. Also, do commenting in the web.config file telling which parts are concerned with which team. This way they can handle the config file on their own by not fiddling with the parts they aren't concerned with.

    You can also take help of VCS (version control systems) to keep track of what changes are made at what time and by which users.