1

I am trying to load a file and its properties in sharepoint

Microsoft.SharePoint.Client.File newFile = null;
newFile = clientContext.Web.GetFileByServerRelativeUrl(relativeURL); 
ListItem item = updateFile.ListItemAllFields;
clientContext.Load(item, i => i.FieldValuesAsText, i=> i.ContentType  );
clientContext.Load(newFile , i => i.CheckOutType, i => i.ListItemAllFields);
clientContext.ExecuteQuery();

This throws "object does not belong to a list" error when the library name and the content type name of the file are same

Works fine otherwise

What is causing this issue?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Vignesh Subramanian
  • 7,161
  • 14
  • 87
  • 150

0 Answers0