I'm trying to figure out a way, using the Sharepoint Client Object Model, to get the content type and the metadata values of a listItem at a specific version.
I can get the different versions using ListItem.File.Version, but once I get that I didn't find any way to get a File or a ListItem that would allow me to know what was the content type of the item when it was at that version and what were the values of the column associated with that content type for that item.
I tried this:
Microsoft.SharePoint.Client.File verFile = clientContext.Web.GetFileByServerRelativeUrl(versionItemUrl);
clientContext.Load(verFile, f => f.ListItemAllFields);
clientContext.ExecuteQuery();
But I always get the following error message: Specified value is not supported for the serverRelativeUrl parameter.
I've also read a bit about the List.GetVersionCollection Method which might be the solution even if I have to make a service call for each column I need. But then again, how do I get the content type of my item at that version? I need it to figure out which columns I want the value of.
Any help appreciated. Thanks in advance!