晚于 OnPublished 的事件处理程序

Event Handler later than OnPublished

创建新项目时,是否有任何晚于 "OnPublished" 事件的 Project Server 事件处理程序事件?

on published事件发生的时间好像有点早。加载项目 FieldValues 不起作用。它们始终为空。

PublishedProject project = projCollection.First().IncludeCustomFields;
projectContext.Load(project);
projectContext.Load(project.IncludeCustomFields);
CustomFieldCollection fields = project.CustomFields;
projectContext.Load(fields);
projectContext.ExecuteQuery();

Dictionary<string, object> fieldValues = project.FieldValues;

为现有项目执行相同的代码时一切正常。

相反,我可以超时 x 秒,但我更喜欢稍后的服务器事件,其中所有值都已设置。

编辑:

在执行此代码之前,我的其他代码似乎有问题。自定义字段和字段值现在正在正确加载。

但此时加载 projectSiteUrl 还为时过早。 ProjectSiteUrl 保持为空。

projectContext.Load(project, p => p.ProjectSiteUrl);
projectContext.ExecuteQuery();

我使用的是 PSI 而不是 CSOM,并且 "ProjectSiteUrl" 在首次发布(OnPublished 事件)后为空。 对于第一次发布,我使用了 WssInteropEventReceiver class 或接口中的 OnWssWorkspaceCreated 事件。

项目完全发布后,将触发 ReportingEventReceiver Class 的 OnProjectChangedRemote 事件。

创建新项目并完成创建过程后,将触发 ReportingEventReceiver Class 的 OnProjectCreatedRemote 事件。