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

Was it helpful?

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);
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top