Expand Minimize

SPD027504: ListDefinition references ContentType

ListDefinition references ContentType

CheckId SPD027504
TypeName ListDefinitionContentTypeReferencesContentType
Severity Information
Type List

A ListDefinition can reference existing ContentTypes in MetaData element. See sample below:

<List xmlns:ows="Microsoft SharePoint" Title="Financial Documents"
   Direction="$Resources:Direction;" Url="Financial Documents"
   BaseType="1"
   EnableContentTypes="TRUE">
   <MetaData>
      <ContentTypes>
         <ContentTypeRef ID="0x01010012841A8869DB425cB829C3875EC558CE01">
            <Folder TargetName="Forms/Document" />
         </ContentTypeRef>
         <ContentTypeRef ID="0x0120" />
      </ContentTypes>
      ...
   </MetaData>
</List>

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":"SPD027504:ListDefinitionContentTypeReferencesContentType","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.