我尝试使用项目服务器 2013 CSOM 更新任务状态进度(状态分配),但出现“未知错误”异常和以下 StackTrace:
在 Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream) 在 Microsoft.SharePoint.Client.ClientRequest.ProcessResponse() 在 Limitless.Components.Project2013.ProjectComponent.UpdateTask(ProjectServerConnection 连接,Guid ProjectUID,List`1 数据)
ProjectContext context = GetProjectContext(connection);
// Get the user name and their assignments
EnterpriseResource self = EnterpriseResource.GetSelf(context);
context.Load(self, r => r.Name, r => r.Assignments
.IncludeWithDefaultProperties(a => a.Project, a=>a.Comments));
context.ExecuteQuery();
foreach(var item in self.Assignments)
{
Entities.Task task = data.Where(t => t.ID == item.Id).SingleOrDefault();
if(task!= null)
{
item.PercentComplete = (short)task.PercentComplete;
item.Comments = "comment";
}
}
// Update the assignments and submit the status updates.
self.Assignments.Update();
self.Assignments.SubmitAllStatusUpdates("By PS Web App");
context.ExecuteQuery();
我在共享点日志中找不到任何错误。它是全新安装的 Project Server 2013,它成功检索了任务(StatusAssignments),但之后self.Assignments.Update();
抛出 self.Assignments.SubmitAllStatusUpdates("By PS Web App");
异常context.ExecuteQuery();
。
有人遇到过这种情况吗?