You can only publish unpublish documents in a minor version enabled list error in SharePoint Online CSOM

Hi folks, today we will see how to fix error You can only publish unpublish documents in a minor version enabled list in SharePoint.

The error comes when we edit SharePoint 2013/2016 or SharePoint Online list and add any component like web parts and check-in/check-out the page using CSOM.

The error comes as:
An unhandled exception of type ‘Microsoft.SharePoint.Client.ServerException’ occurred in SiteCreation.exe.

Additional information: You can only publish, unpublish documents in a minor version enabled list.

The error looks like below:

You can only publish unpublish documents in a minor version enabled list sharepoint online

You can only publish unpublish documents in a minor version enabled list

We need to enable EnableMinorVersions property like below:

list.EnableMinorVersions = true;

The code looks like below:

You can only publish unpublish documents in a minor version enabled list
You can only publish unpublish documents in a minor version enabled list sharepoint

You may like following SharePoint CSOM tutorials:

This SharePoint tutorial, we learned how to fix an error You can only publish unpublish documents in a minor version enabled list.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>