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.


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. http://www.novolocus.com/2009/12/24/adding-and-removing-web-config-modifications/

  • Damn, this was supposed to be a comment, not an answer – Andy Burns Jul 9 '12 at 11:10

http://msdn.microsoft.com/en-us/library/bb861909.aspx & http://msdn.microsoft.com/en-us/library/ms439965.aspx should help you. I beleive it is best practice not to edite the web.config files by hand.

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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