Expand Minimize

SMA265601: Avoid deployment of ContentTypeBindingDefinition via Feature Framework

Deploying ContentTypeBindingDefinition through the Feature Framework creates dependencies on the provisioning XML files. Break this dependency to help future migrations, and updates by using the Remote Provisioning techniques from Microsoft.

CheckId SMA265601
TypeName ContentTypeBindingRecommendations
Severity CriticalWarning
Type ContentTypeBinding

Full Trust Approach App Approach
Content Types

A content type is a shared definition of a list. It describes Fields and Views, which can be reused where they are deployed.

Content Type Binding

A Content Type Binding, is part of the Onet.xml. The Onet.xml file is a part of the Site Definition, providing a full description of all lists, libraries, features, and settings that are to be setup on a SharePoint site, when created.

Paradigm Shift - Deployment through Code

An alternate method is the creation of Content Types through code, then using these Content Types to create lists. This method takes the structure of a List, and creates the Content Type programmatically. While also popular in Full-Trust solutions, it is the preferred method through the App Model, doing the same provisioning process remotely.

Impact of Full Trust Approach Benefit of App Approach
Dependency on Deployed Files

When you create a an element in SharePoint from a Declarative file, the content you have created is then dependent on the xml files they are described in. When these need to be retracted, due to an update, a change in the system, or part of a disaster recovery plan, this link is broken. This will ultimately cause issues in the long run.

Cloud Application Model

The Cloud Application Model or CAM, is designed to create content through code, therefore not creating any dependency links.

Efforts and Benefits

Migration Impact High
Re-Design Effort Medium
Re-Development Effort High
Long Term Benefit Critical

Effort Drivers

  • No hard links between the provisioning procedure, and the content
  • Easily Migratable, and Future Proofed

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":"SMA265601:ContentTypeBindingRecommendations","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.