从构建获取BuildAgent信息 [英] Getting the BuildAgent information from a Build

查看:110
本文介绍了从构建获取BuildAgent信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个IBuildDetail变量,我需要的版本信息。

I have a IBuildDetail variable with the build information I need.

好了,但是当我检查的属性BuildAgent它显示的:build.BuildAgent引发了异常类型的System.NotImplementedException

Okay, but when I check the property BuildAgent it's showing this: build.BuildAgent' threw an exception of type 'System.NotImplementedException

然后我trye​​d检查build.BuildController.Agents,很高兴我找到了BuildAgent,但也有在此集合7生成代理。我只需要生成代理与我的身材,并不是所有从控制器建立代理。

Then I tryed to check build.BuildController.Agents, it's nice I found the BuildAgent, but there are 7 build agents in this collection. I need only the build agent related to my build, not all build agents from that controller.

任何人都知道如何得到这些信息? (使用IBuildDetail变量选择的生成代理的名称或计算机名称)

Anyone knows how to get that information? (Select a build agent name or machine name using an IBuildDetail variable)

- >我使用TFS2010 API,我需要的是为每个构建代理

推荐答案

这就像Duat说。
要回答的这个的问题,我有机会去探索这个
以下工作对于一个给定 IBuildDetail buildDetail &放大器。访问 IBuildServer编译服务

It's like Duat says.
In order to answer this question, I had the chance to explore this.
The following worked for a given IBuildDetail buildDetail & access to a IBuildServer buildService:

IBuildInformation buildInformation = buildDetail.Information;
IBuildInformationNode[] buildInformationNodes = buildInformation.Nodes;
string agentUri = buildInformationNodes[0].Children.Nodes[3].Fields["ReservedAgentUri"];
IBuildAgent buildAgent = buildService.GetBuildAgent(new Uri(agentUri));

这篇关于从构建获取BuildAgent信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆