如果企业资源池包含超过 1000 个资源,则项目 CSOM 无法添加新的任务请求

问题描述

我使用以下代码通过 Project Server 2019 上的 CSOM 添加新任务请求:

        var resources = projectContext.LoadQuery(projectContext.EnterpriseResources.Where(n => n.Name == username));
        projectContext.ExecuteQuery();

        var resource = resources.ElementAtOrDefault(0);

        StatusAssignmentCreation@R_545_4045@ion creation@R_545_4045@ion = new StatusAssignmentCreation@R_545_4045@ion();
        creation@R_545_404[email protected] = projectGuid;
        creation@R_545_404[email protected] = "new task";

        creation@R_545_404[email protected] = new StatusTaskCreation@R_545_4045@ion() { Name = "New Task" };
        creation@R_545_404[email protected] = DateTime.Now;
        creation@R_545_404[email protected] = DateTime.Now.AddDays(7);
        resource.Assignments.Add(creation@R_545_4045@ion);
        resource.Assignments.Update();
        resource.Assignments.SubmitAllStatusUpdates("new task");

        projectContext.ExecuteQuery();

如果项目服务器包含 projectContext.ExecuteQuery() 步骤中生成以下错误

资源过多:1132,无法加载更多依赖对象 1000多个资源。使用过滤器来限制您的查询

但是,代码中没有包含对 1132 个资源的任何查询(第一行只有 1 个资源)。

我该如何解决这个问题?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)