我编写了以下代码以ProjectSiteUrl
从 Project Online 中发布的项目中获取属性
using (ProjectContext projContext = new ProjectContext(pwaUrl))
{
using (SecureString securePassword = new SecureString())
{
Helper.GetSecurePassword(projContext, securePassword, emailID, password);
for (int i = 0; i < listGuid.Count; i++)
{
#region Load Project
string spoGuid = listGuid[i].ProjectGuid;
if (!string.IsNullOrEmpty(spoGuid))
{
Guid id = Guid.Parse(spoGuid);
var projBlk = projContext.LoadQuery(
projContext.Projects
.Where(p =>
p.Id == id
)
.Include(p => p.Id,
p => p.Tasks,
p => p.TaskLinks,
p => p.ScheduledFromStart,
p => p.ProjectSiteUrl,
p => p.Name,
p => p.IncludeCustomFields,
p => p.IncludeCustomFields.CustomFields,
P => P.IncludeCustomFields.CustomFields.IncludeWithDefaultProperties(
lu => lu.LookupTable,
lu => lu.LookupEntries,
lu => lu.LookupEntries.IncludeWithDefaultProperties(
entry => entry.FullValue,
entry => entry.InternalName)
)
)
);
projContext.ExecuteQuery();
poFieldValues.Add(LoadProjectsinPO(projBlk, projContext));
}
#endregion
//if (i > 5)
//{
// break;
//}
if (i % 5 == 0)
{
Thread.Sleep(sleepDelay);
}
}
}
}
在尝试访问我得到的 ProjectSiteUrl 属性时null
。我曾经得到正确的 ProjectSiteUrl,但在过去的几周里,我得到了空值。代码没有变化。
我们在 Project Online 中访问此属性的方式是否发生了变化?