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
We need to enable EnableMinorVersions property like below:
list.EnableMinorVersions = true;
The code looks like below:
You may like following SharePoint CSOM tutorials:
- Create SharePoint Workflow History list using csom programmatically
- Copy list items from one list to another in SharePoint programmatically using CSOM
- Steps to add items from CSV file to SharePoint Online List using PowerShell in CSOM
- How to Use CAML Query for Boolean field for SharePoint 2013/2016/Online Object Model CSOM
- SharePoint: Add a site column to list programmatically using CSOM
- Create an index in SharePoint Online list using CSOM
- Check if user belongs to SharePoint group using CSOM
- Get all subsites from a site collection in SharePoint Online using CSOM
- Get all users from SharePoint group programmatically using csom
- Delete sites and subsites programmatically using CSOM in SharePoint Online
- Read CSV file from SharePoint document library programmatically using CSOM
- Create a folder in the SharePoint document library using CSOM
- Activate SharePoint Server Publishing Feature programmatically using CSOM
- Add lookup column to SharePoint list programmatically using CSOM
- The collection has not been initialized SharePoint
- Display DOC ICON in SharePoint custom page
This SharePoint tutorial, we learned how to fix an error You can only publish unpublish documents in a minor version enabled list.
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com
Download SharePoint Online Tutorial PDF FREE!
Get update on Webinars, video tutorials, training courses etc.