Modify Web.config File Dynamically in SharePoint 2010 - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Sunday, May 20, 2012

Modify Web.config File Dynamically in SharePoint 2010

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.

No comments:

Post a Comment