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.