Do you turn off auto activation on farm and web application scope features?

Updated by Brady Stroud [SSW] 1 year ago. See history

123
<introEmbed body={<> Each SharePoint packages contains features that can be targetted at various scopes. You need to pay special attention when you are targetting the Web Application scope. The feature XML looks like this. ```xml <Feature Id="{GUID}" Title="WebApplicationConfiguration" Scope="WebApplication" Version="1.0.0.0" Hidden="FALSE" DefaultResourceFile="core" xmlns="http://schemas.microsoft.com/sharepoint/" >   <ElementManifests /> </Feature> ``` But there is a problem... </>} />

The problem with this web application feature is that it will activate by default on all new Web Applications created on that farm, regardless of what the web application or root site template is.

The best practice is to make sure you use the additional attribute ActivateOnDefault and set it to False. Then SharePoint administrators can choose to activate the feature after a new web application is created.

<Feature
Id="{GUID}"
Title="WebApplicationConfiguration"
Scope="WebApplication"
Version="1.0.0.0"
Hidden="FALSE"
DefaultResourceFile="core"
xmlns="http://schemas.microsoft.com/sharepoint/"
ActivateOnDefault="False"
>
  <ElementManifests />
</Feature>

Acknowledgements

John Liu
Related rules

Need help?

SSW Consulting has over 30 years of experience developing awesome software solutions.

We open source.Loving SSW Rules? Star us on GitHub. Star