I am trying to read/get properties of SP document using csom it was working fine until last week. But now suddenly getting error "Column 'Attachments' does not exist. It may have been deleted by another user". This was working since many years but now throwing error. Any idea whether Microsoft changed any thing recently?
the code flow is below
ListItem itemToManage = null;
Web parentWeb = null;
List parentList = null;
this.Site = this.ClientContext.Site;
parentWeb = this.Site.OpenWebById(webId);
parentList = parentWeb.Lists.GetById(listId);
this.RootWeb = this.Site.RootWeb;
itemToManage = parentList.GetItemById(itemId);
ConditionalScope scope = new ConditionalScope(ClientContext, () => (parentWeb.ServerObjectIsNull.Value != true)
&& (parentList.ServerObjectIsNull.Value != true) && (itemToManage.ServerObjectIsNull.Value != true));
using (scope.StartScope())
{
//Get all the associated properties and objects generally needed by most of the management processes
ClientContext.Load<ListItem>(itemToManage, i => i.DisplayName, i => i, i => i.Folder, i => i.Folder.Name, i => i.AttachmentFiles,
i => i.RoleAssignments.Include(ra => ra, ra => ra.Member, ra => ra.Member.Id, ra => ra.Member.LoginName, ra => ra.RoleDefinitionBindings.Include(rd => rd, rd => rd.BasePermissions, rd => rd.Name, rd => rd.Id)),
i => i.ParentList, i => i.ParentList.Id, i => i.ParentList.DefaultViewUrl, i=>i.ParentList.DefaultDisplayFormUrl, i => i.ParentList.Views, i => i.ParentList.Fields, i => i.ParentList.RootFolder, i => i.ParentList.RootFolder.ServerRelativeUrl, i => i.ParentList.ContentTypes.Include(c => c, c => c.Fields),
i => i.ParentList.EventReceivers, i => i.ParentList.EventReceivers.Include(er => er.ReceiverName), i => i.ParentList.Description,
i => i.ContentType, i => i.ContentType.Fields, i => i.ContentType.Parent, i => i.ContentType.Parent.Id,
i => i.ParentList.ParentWeb, i => i.ParentList.ParentWeb.Id, i => i.ParentList.ParentWeb.SiteUsers, i => i.ParentList.ParentWeb.Language, i => i.ParentList.ParentWeb.RegionalSettings.TimeZone,
i => i.ParentList.IsApplicationList, i => i.ParentList.IsCatalog, i => i.ParentList.IsPrivate, i => i.ParentList.IsSiteAssetsLibrary, i => i.ParentList.Hidden, i => i.ParentList.BaseTemplate,
i => i.ParentList.ParentWeb.SiteGroups.Include(g => g, g => g.Users, g => g.Id, g => g.LoginName, g => g.PrincipalType, g => g.Users.Include(u => u, u => u.LoginName, u => u.IsSiteAdmin, u => u.Id)),
i => i["FileDirRef"],
i => i.HasUniqueRoleAssignments);
this.ClientContext.Load<Web>(this.RootWeb, rs => rs, rs => rs.Title);
this.ClientContext.Load<Site>(ClientContext.Site, s => s.Id, s => s.Url);
}
this.ExecuteQuery();
if ((null == scope.TestResult) || (!scope.TestResult.Value))
{
itemToManage = null;
}
return itemToManage;
Any help much appreciated.
Thanks,
Ravi Nalla