Remarks

Template Awareness

When building templates, you may encounter a few unexpected behaviors. This section highlights common issues and explains how to address them.

Content Types Deletion

When SharePoint creates a content type, it assigns a NextChildByte value in the database. Each new content type increments this value (01, 02, 03, and so on).
If a content type is deleted, the NextChildByte value does not reset. For example:

  • Create CTs → IDs end with 01, 02, 03
  • Delete CT 03
  • Create a new CT → ID becomes 04

If you export these content types, your template might contain 01, 02, and 04. Applying this template to a new site can fail because the new site’s NextChildByte does not match the content type IDs in the template.

To fix this, manually add the missing content type IDs (such as 03) so the sequence aligns again.
This limitation comes from CSOM and cannot be solved programmatically. Any template that includes content types should be reviewed to ensure no deleted types create gaps in the sequence.

Document ID Feature

When the Document ID feature is enabled and the Content Type Hub pushes content types, verify that the Document ID event receivers are attached to every library where document IDs must be generated.

Example:

1
2
3
4
5
6
<RemoteEventReceivers>
   <RemoteEventReceiver ReceiverName="Document ID Generator (ItemAdded)" ReceiverAssembly="Microsoft.Office.DocumentManagement, Version=16.0.0.0, Culture=neutral,  PublicKeyToken=71e9bce111e9429c" ReceiverClass="Microsoft.Office.DocumentManagement.Internal.DocIdHandler" EventType="ItemAdded" Synchronization="Synchronous" />
   <RemoteEventReceiver ReceiverName="Document ID Generator (ItemCheckedIn)" ReceiverAssembly="Microsoft.Office.DocumentManagement, Version=16.0.0.0, Culture=neutral,  PublicKeyToken=71e9bce111e9429c" ReceiverClass="Microsoft.Office.DocumentManagement.Internal.DocIdHandler" EventType="ItemCheckedIn" Synchronization="Synchronous" />
   <RemoteEventReceiver ReceiverName="Document ID Generator (ItemUncheckedOut)" ReceiverAssembly="Microsoft.Office.DocumentManagement, Version=16.0.0.0, Culture=neutral,  PublicKeyToken=71e9bce111e9429c" ReceiverClass="Microsoft.Office.DocumentManagement.Internal.DocIdHandler" EventType="ItemUncheckedOut" Synchronization="Synchronous" />
   <RemoteEventReceiver ReceiverName="Document ID Generator (ItemUpdated)" ReceiverAssembly="Microsoft.Office.DocumentManagement, Version=16.0.0.0, Culture=neutral,  PublicKeyToken=71e9bce111e9429c" ReceiverClass="Microsoft.Office.DocumentManagement.Internal.DocIdHandler" EventType="ItemUpdated" Synchronization="Synchronous" />
</RemoteEventReceivers>