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.

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

Bhawana Rathore

Hello Everyone!! I am Bhawana a SharePoint MVP and having about 8+ years of SharePoint experience as well as in .Net technologies . I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools . Now exploring more in SharePoint 2016 :) Hope here I can contribute and share my knowledge to the fullest. As I believe "There is no wealth like knowledge, and no poverty like ignorance"

>