Sharepoint Online, Getting the Versions of a document only returns older versions of the document and not the current

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/240116

Question

I am developing a desktop app in c# using CSOM to run against an o365 SharePoint solution.

I managed to get the version, however in testing I have noticed that I am always getting the second newest version instead of the newest. Even when logging out every single version of the document the current version (ver 1.0) does not seem to be visible see code and screenshot below for clarification.

//Code to get all versions the code used to get all versions

//Result

The output from the code, does not reach version 1

//Version History for the document The documents version history, reaches version 1

Était-ce utile?

La solution

Yes, you need to output the latest version of the file out the foreach:

// Get the latest version of the file

checkedListBox4.Items.Add("this" + item["FileRef"].ToString() + ":" + newsItemFile.UIVersionLabel);
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top