Expand Minimize

Do not define attribute 'ActiveOnDefault' in Feature with Scope 'Web' or 'Site'

Attribute 'ActivateOnDefault' cannot be 'TRUE' for Feature with Scope 'Web' or 'Site', except in Sandboxed solutions. In Sandboxed solutions the attribute is used during activation of the solution to activate Feature with scope 'Site'. This behavior is not documented in MSDN and may be unexpected und unintended.

CheckId SPC012111
TypeName DoNotDefineActiveOnDefaultInWebOrSiteFeatures
Severity Error
Type Feature

Completely remove attribute 'ActivateOnDefault' from a Feature with Scope 'Web' or 'Site'.

There is different behavior of the attribute 'ActiveOnDefault' between farm solutions and sandboxed solutions. But SPCAF cannot differentiate between a farm solution and a sandboxed solution because both types look the same. Therefore the rule detects a error violation if the attribute is used to warn the developer of this potenially unexpected behavior.

To suppress this violation in XML SharePoint code add the following comment right before the XML tag which causes the rule violation. Learn more about SuppressMessage here.

<!-- "SuppressMessage":{"rule":"SPC012111:DoNotDefineActiveOnDefaultInWebOrSiteFeatures","justification":"Provide reason for suppression here"} -->
Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.