Posts

Showing posts from June, 2010

SPWebConfigModifications and Manual Config entries don't mix

This is just a short post for my own retention and edification - As it is considered best practice to deploy web.config modifications using the SharePoint object model and calling  ApplyWebConfigModifications() and Update() on the SPWebService , I want to make note of a few caveats. When  ApplyWebConfigModifications()  is called, SharePoint behind-the-scenes looks at the collection of SPWebConfigModifications for EACH web application in the farm and applies those changes. It doesn't matter if you called it for a specific web application; this propagation of config changes is pushed for every web.config that is associated with a web application that contains these SPWebConfigModification entries. The problem here, is that if you have made any manual configuration changes (for example, if you have to encrypt a section for security purposes), once that  ApplyWebConfigModifications()  gets called, those entries are reverted back to whatever value they were entered within that SPWe