Expand Minimize

SMA265101: Avoid deployment of Fields via Feature Framework

Deploying fields 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 SMA265101
TypeName FieldRecommendations
Severity CriticalWarning
Type Field

Full Trust Approach App Approach
Fields

A field is the XML definition of a Site Column, used in Content Types and Lists to provide an input field of the desired type.

Paradigm Shift - Deployment through Code

An alternate method is the creation of Fields through code. This method takes the structure of a list and creates the Fields, Content Type, and Lists 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":"SMA265101:FieldRecommendations","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.