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?