Expand Minimize

Deploy missing ListDefinition in CustomSchema of ListInstance

A ListInstance can directly reference a ListDefinition in attribute 'CustomSchema'. This ListDefinition must be depoyed in the same Feature as ElementFile.

CheckId SPC015406
TypeName DeployMissingCustomSchemaForListInstance
Severity CriticalError
Type ListInstance

Deploy the specified ListDefinition or remove the ListInstance. See sample below:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
   <ListInstance
      TemplateType="121"
      Title="Solution Gallery"  
      Url="_catalogs/solutions"  
      CustomSchema="Files\_catalogs\solutions\Schema.xml"  
      RootWebOnly="TRUE" xmlns="http://schemas.microsoft.com/sharepoint/" />
</Elements>

Expected Schema.xml in Feature:
<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Id="a3342be9-2b7c-44c5-a0c5-0259343a4000" Scope="Web" ...>  
   <ElementManifests>
      <ElementFile Location="Files\_catalogs\solutions\Schema.xml" />
      ...
   </ElementManifests>
<Feature>

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":"SPC015406:DeployMissingCustomSchemaForListInstance","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.