SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


We currently have a deployment process which is partially automated and part manual. The manual part involves making manual changing to the web.config for some things. We have two load balanced front end web servers and therefore these are manually made on both as part of deployment.


Is there anyway of automating this step so changes are replicated on both front end servers without manual intervention.

share|improve this question
up vote 1 down vote accepted

Yes. That code is run on each server. If you came along later and added a new server to the farm, that code (and, therefore, the Web.config change) would be run on the new server too. John is right, this is the mechanism you want to use. Note that you should also remove your web.config changes when the solution is uninstalled.

share|improve this answer
Thanks Andy & Jon will give this a go. – Miyagi Jul 9 '12 at 10:40
Damn, this was supposed to be a comment, not an answer – Andy Burns Jul 9 '12 at 11:10 & should help you. I beleive it is best practice not to edite the web.config files by hand.

share|improve this answer
John this code makes amendments to web.config however on automated deployments will this make changes to multiple webconfig files which are stored on different server? and what would happen in subsequent deployments. – Miyagi Jul 9 '12 at 10:02
Should this be placed in the feature reciever or create a custom feature reciever for all web.config updates as we are using Sharepoint. – Miyagi Jul 9 '12 at 10:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.