Expand Minimize

Declare required attributes in ContentType

Required attributes ID and Name must be declared in ContentType.

CheckId SPC015203
TypeName DeclareRequiredAttributesInContentType
Severity CriticalError
Type ContentType

Add missing attribute 'ID' and 'Name' to ContentType. See sample below:

<ContentType
   ID="0x0101"
   Name="$Resources:Document"
   Group="$Resources:Document_Content_Types"
   Description="$Resources:DocumentCTDesc"
   V2ListTemplateName="doclib"
   Version="0">
   <FieldRefs>
      <RemoveFieldRef ID="{ae069f25-3ac2-4256-b9c3-15dbc15da0e0}" Name="GUID" />
      <FieldRef ID="{5f47e085-2150-41dc-b661-442f3027f552}" Name="SelectFilename" />
      ...
   </FieldRefs>  
</ContentType>

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":"SPC015203:DeclareRequiredAttributesInContentType","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.