Recently I was asked to modify a custom solution downloaded from CodePlex to allow it to updated web.config file programmatically. The deployment steps provided from CodePlex involve manual modification to web.config files on all WFE servers across the farm which is not a best practice approach for deploying custom solutions.

There are many other articles and posts discussing the same topic, however many people had the same issue that I was facing;
  • It adds multiple entries into web.config file where it should only add one single entry.
  • It does not delete entries from web.config file.
I'd just want to share my complete code for people who would like to get more idea on how this is done in SharePoint.


How to: Add and Remove Web.config Settings Programmatically
http://msdn.microsoft.com/en-us/library/bb861909.aspx

I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too. 

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.