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).

1 Answer 1


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


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.