gpt4 book ai didi

c# - 在 Project Server 2013 CSOM 中处理草稿项目时出现 CSOMUnknownUser 错误

转载 作者:行者123 更新时间:2023-11-30 16:49:19 25 4
gpt4 key购买 nike

我正在尝试使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com