0

我调用 IBuildServer.QueryBuilds(),并查看返回IBuildDetail的 s:

  • TFS2010:它们填充了用户别名。
  • TFS2012:它们为空。

如何获取 TFS2012 中的用户名?

var collection = new TfsTeamProjectCollection(new Uri(_txtCollection.Text));
var buildServer = collection.GetService<IBuildServer>();

var spec = buildServer.CreateBuildDetailSpec(Settings.Default.ProjectName);
spec.QueryOptions = QueryOptions.Definitions;
spec.QueryOrder = BuildQueryOrder.StartTimeDescending;
spec.InformationTypes = null;

return buildServer.QueryBuilds(spec).Builds;
4

1 回答 1

0

添加批处理请求:

spec.QueryOptions = QueryOptions.Definitions
                  | QueryOptions.BatchedRequests;  // Tell TFS2012 to populate RequestedFor / RequestedBy
于 2013-03-13T18:41:09.220 回答