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

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

Hi folks, today we will see how we can resolve below error which is the most common when we edit SharePoint 2013/2016 or SharePoint online (Download PDF for FREE) 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.

SharePoint deveopment training course

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
You can only publish unpublish documents in a minor version enabled list

Code solution:

We need to enable EnableMinorVersions property like below:

list.EnableMinorVersions = true;

The code looks like below:

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

Read some sharepoint online tutorials:

Hope this will be helpful.

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

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

envelope
envelope

About 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"

View all posts by Bhawana Rathore →