TFS API InformationNodeConverters.GetAssociatedChangesets() 未按预期工作
我想我可能误解了这个函数的目的,但这是我的问题。
当我查看构建摘要时,我看到构建成功运行,它告诉我:
[person] triggered [build number] ([project]) for changeset 123456
我有以下代码,它在控制台应用程序中运行,告诉我构建中包含哪些变更集。
IBuildDefinition[] result = buildServer.QueryBuildDefinitions(teamProj.Name);
foreach (IBuildDefinition def in result)
{
IBuildDetail[] dets = def.QueryBuilds();
foreach (IBuildDetail det in dets)
{
det.RefreshAllDetails();
// Get changesets for the buildList<IChangesetSummary>
changes = InformationNodeConverters.GetAssociatedChangesets(buildDetail);
foreach (IChangesetSummary changeset in changes)
{
}
}
}
问题是这不会返回任何结果。信息属性有 6 个节点,其中没有一个与变更集或工作项相关。为什么 VS2010 构建摘要告诉我我有一个关联的变更集,但下面的代码告诉我不同?
I think I may have misunderstood the purpose of this function, but here's my problem.
When I look in the build summary, I see that a build ran successfully, and it tells me:
[person] triggered [build number] ([project]) for changeset 123456
I have the following code, which runs in a console app to tell me what changesets were included in a build.
IBuildDefinition[] result = buildServer.QueryBuildDefinitions(teamProj.Name);
foreach (IBuildDefinition def in result)
{
IBuildDetail[] dets = def.QueryBuilds();
foreach (IBuildDetail det in dets)
{
det.RefreshAllDetails();
// Get changesets for the buildList<IChangesetSummary>
changes = InformationNodeConverters.GetAssociatedChangesets(buildDetail);
foreach (IChangesetSummary changeset in changes)
{
}
}
}
The problem is that this returns nothing. The Information propery has 6 nodes, none of which relate to a changeset or a workitem. Why does VS2010 build summary tell me that I have an associated changeset, but the code below tells me different?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
构建的状态如何? (成功、失败或部分成功)?另外,您使用哪个构建过程模板?您是否使用默认的构建过程模板?如果是,您是否对其进行了任何更新?如果您自定义构建以获得AssociateChangesetsAndWorkItems 构建活动以正常工作。
我在这里帮助 Andy Lewis 提供了一些信息:http://blogs.msdn.com/b/andy-lewis/archive/2011/01/31/how-good-was-that-build.aspx
您的字符串提到的实际上并不表明存在关联的变更集。在构建摘要屏幕上,您应该看到一个显示“关联变更集”的部分。如果不这样做,那么这通常是存在问题的第一个迹象。
请告诉我们一些其他信息,我将很乐意为您提供帮助!
What is the state of the build? (Successful, Failed, or Partially Succeeded)? Also, which build process template are you using? Are you using the default build process template and if you are have you made any updates to it? There are a few things that you have to make sure you keep in place if you customize the build to get the AssociateChangesetsAndWorkItems build activity to work properly.
I helped Andy Lewis with some of that information here: http://blogs.msdn.com/b/andy-lewis/archive/2011/01/31/how-good-was-that-build.aspx
The string you mentioned isn't actually what indicates that there are associated changesets. On the build summary screen, you should see a section that says "Associated Changesets." If you don't, then that usually is the first sign that there is a problem.
Let us know some additional information and I'll be happy to help!