SPC012111: 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 behaviour is not documented in MSDN and may be unexpected und unintended.

TypeName: DoNotDefineActiveOnDefaultInWebOrSiteFeatures
CheckId: SPC012111
Severity: Error
Type: Feature
Resolution

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

Remarks

There is different behaviour 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 behaviour.

comments powered by Disqus