作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 Project Server 2013 CSOM,我可以进行身份验证、读取任何信息、创建新项目等,但是我对草稿项目有疑问,无论如何当我想对草稿项目执行查询时我收到错误消息 CSOMUnknownUser
和任何东西。在我的搜索中,我没有得到关于此错误的特殊信息并且
这是我的部分代码:
context = GetContext(pwaInstanceUrl);
// Retrieve publish project named "New Project"
// if you know the Guid of project, you can just call context.Projects.GetByGuid()
csom.PublishedProject project = GetProjectByName(projectName, context);
if(project == null)
{
Console.WriteLine("Failed to retrieve expected data, make sure you set up server data right. Press any key to continue....");
return;
}
csom.DraftProject draft = project.CheckOut();
// Retrieve project along with tasks & resources
context.Load(draft, p => p.StartDate,
p => p.Description);
context.Load(draft.Tasks, dt => dt.Where(t => t.Name == taskName));
context.Load(draft.Assignments, da => da.Where(a => a.Task.Name == taskName &&
a.Resource.Name == localResourceName));
context.Load(draft.ProjectResources, dp => dp.Where(r => r.Name == localResourceName));
context.ExecuteQuery();
我在最后一行收到错误 context.ExecuteQuery()
最佳答案
执行这些命令时: context.Load(draft.Assignments, da => da.Where(a => a.Task.Name == taskName && a.Resource.Name == localResourceName));<br/>
尝试删除
context.Load(draft.ProjectResources, dp => dp.Where(r => r.Name == localResourceName));da=>da.Where(r => r.Name == localResourceName)
位并检查您要查找的资源是否确实存在于 Project Server 上。如果有帮助,请告诉我
关于c# - 在 Project Server 2013 CSOM 中处理草稿项目时出现 CSOMUnknownUser 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36881274/
我正在尝试使用 Project Server 2013 CSOM,我可以进行身份验证、读取任何信息、创建新项目等,但是我对草稿项目有疑问,无论如何当我想对草稿项目执行查询时我收到错误消息 CSOM
我是一名优秀的程序员,十分优秀!