I am currently in the process of documenting some development best practises in advance of beginning dev on SP2010.

One issue we have at present is that we make changes to web.config files manually. These changes sometimes differ between Web apps based on what "features" a customer is licensed to use (not SharePoint features - this relates to our product).

I have read on MSDN that the best method of applying web.config changes is to either create a supplemental .config file or to apply the changes using the object model.

2 questions really:

  1. Which option would you suggest and,
  2. Is there a way of applying these changes on a per Web app basis, e.g. through the use of a solution package deployed selectively?

Thanks in advance, Ben.

1 Answer 1


Use the object model (SPWebconfigModification), it applies the changes to all the web front ends of the specific web app you're working with.

  • I think sharepointchick.com has something to add on the topic. Mirjam van Olst included a recommendation to avoid SPWebConfigModification in certain situations in her presentation for Developer Connections Amstredam. Would be great to have that opinion here as well. Dec 23, 2010 at 3:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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