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

The SPWebConfigModification class can be used for updating content web applications and also central administration. This can be applied to the SPWebApplication and also SPWebService classes. SPWebService derives from SPService, and has the WebConfigModifications property and the ApplyWebConfigModifications() method.

Is it possible, however, to register modifications to be applied to service applications? Service applications are reprented by classes that derive from SPIisWebServiceApplication, which derives from SPServiceApplication, i.e. is in a different branch of the class hierarchy derived from SPService and does not have the WebConfigModifications property.

For example if you need to make web.config modifications to the security token service (represented by the internal class SPSecurityTokenService, which derives from SPIisWebServiceApplication).

I considered a solution to deploy a replacement web.config into 14\WebServices\SecurityToken, but not sure if that is too messy (and you can't, for example, easily parametise the settings).

share|improve this question

Is it possible, however, to register modifications to be applied to service applications


This is exactly the reason why I tend to do all my web.config changes with xsl transforms/xml pokes

Web.Config changes to extended sites programatically

share|improve this answer
I have had issues when using the IIS7 powershell plugins to set web.config blocks too – djeeg May 4 '11 at 7:50
+1! SPWebConfigModification is a native, but a very buggy way of doing this. Take a look at this post:… – Andrey Markeev May 4 '11 at 7:57

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.