SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 4 down vote accepted

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

share|improve this answer
I think 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. – Alexey Krasheninnikov Dec 23 '10 at 3:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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