Expand Minimize

Do not deploy empty Assemblies

Assemblies without custom classes should not be deployed to SharePoint. This helps to reduce unneeded IISResets during deployment.

CheckId SPC060206
TypeName DoNotDeployEmptyAssemblies
Severity Warning
Type Assembly

Remove empty Assembly from Solution.
Sometimes it may be necessary to deploy an empty assembly. One reason could be to avoid a 'Globally' deployment of the Solution and enforce the deployment 'per Webapplication'. This can achieve by adding a 'SafeControl' to the manifest.xml. But this makes an assembly necessary which may be empty.
Visual Studio automatically includes the assembly in WSP packages. To avoid this set property 'Include Assembly in Package' to FALSE.

To suppress this violation in managed code add the following attribute to the method which contains the instruction (available since SPCAF version v5.2). Learn more about SuppressMessage here.

// Important: Ensure to have #define CODE_ANALYSIS at the beginning of your .cs file
[SuppressMessage("SPCAF.Rules.DeploymentGroup", "SPC060206:DoNotDeployEmptyAssemblies", 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.