简体   繁体   English

Team Foundation Server 2005 API

[英]Team Foundation Server 2005 API

I want to retrieve a list of build definitions for a given team project name using the TFS 2005 Api. 我想使用TFS 2005 Api检索给定团队项目名称的构建定义列表。

For TFS 2010 and onwards, the normal procedure to do this would be: 对于TFS 2010及更高版本,执行此操作的正常过程为:

        TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri(Uri));

        IBuildServer buildServer = (IBuildServer)tfs.GetService(typeof(IBuildServer));

        var buildDefinitions = buildServer.QueryBuildDefinitions(projectName);

This would normally return an array of IBuildDefinition and I can query the name property. 通常,这将返回IBuildDefinition数组,我可以查询name属性。

However, in this case I am trying to access a TFS 2005 server and it gives the exception: 但是,在这种情况下,我试图访问TFS 2005服务器,但它给出了异常:

"NotSupportedException - TF214015: The build client object model does not support Team Foundation >Server 2005". “ NotSupportedException-TF214015:构建客户端对象模型不支持Team Foundation> Server 2005”。

Could anybody suggest the best way to retrieve a list of build definitions? 有人可以建议最好的方法来检索构建定义列表吗? Upgrading the 2005 server is not an option at this moment. 目前无法升级2005服务器。

Thanks. 谢谢。

In TFS 2005 you could only access the actual builds themselves (ie the results of a build), not the build definitions. 在TFS 2005中,您只能访问实际的内部版本(即内部版本的结果),而不能访问内部版本的定义。 Querying build definitions was only added with TFS 2008. 仅在TFS 2008中添加了查询构建定义。

*Note: I'm working from memory here, so I may be wrong, but the MSDN page backs me up (see the 'other versions' drop down) *注意:我在这里是从内存中工作的,所以我可能是错的,但是MSDN页面支持我(请参见“其他版本”下拉列表)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM