Sharepoint Online, Getting the Versions of a document only returns older versions of the document and not the current
-
15-01-2021 - |
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.
//Result
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