Sharepoint 获得;值不在预期范围内;与CSOM创建新讨论时

Sharepoint 获得;值不在预期范围内;与CSOM创建新讨论时,sharepoint,sharepoint-2010,sharepoint-2013,csom,Sharepoint,Sharepoint 2010,Sharepoint 2013,Csom,我正在使用SharePoint 2013客户端对象模型 我得到一个Microsoft.SharePoint.Client.ServerException,在运行_context.ExecuteQuery()时显示:“值不在预期范围内”。只要我注释掉语句entry[“Author”]=authorValue,代码就可以工作: entry["Body"] = post.Body; entry["Created"] = post.Created; entry["Modified"] = post.Mo

我正在使用SharePoint 2013客户端对象模型

我得到一个Microsoft.SharePoint.Client.ServerException,在运行_context.ExecuteQuery()时显示:“值不在预期范围内”。只要我注释掉语句
entry[“Author”]=authorValue,代码就可以工作

entry["Body"] = post.Body;
entry["Created"] = post.Created;
entry["Modified"] = post.Modified;

FieldUserValue authorValue = new FieldUserValue();
User author = _context.Web.EnsureUser("Mr. X");
_context.Load(author);
_context.ExecuteQuery();
authorValue.LookupId = author.Id;

entry["Author"] = authorValue;

entry.Update();
_context.ExecuteQuery();
“Author”是有效的字段名。我还阅读了关于将“列表视图查找阈值”增加到20英寸的内容。但该值已经设置为5000

我还检查了
entry[“Author”]
的值,但没有显式设置(
entry[“Author”]=authorValue
注释掉),方法是添加以下两条语句:

_context.Load(entry);
_context.ExecuteQuery();
它的类型为Microsoft.SharePoint.Client.FieldUserValue
,它的
LookupId
属性值等于
authorValue.LookupId


我错过了什么?

您找到解决方案了吗?我这里有一个可能相关的问题: