简体   繁体   中英

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.

For TFS 2010 and onwards, the normal procedure to do this would be:

        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.

However, in this case I am trying to access a TFS 2005 server and it gives the exception:

"NotSupportedException - TF214015: The build client object model does not support 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.

Thanks.

In TFS 2005 you could only access the actual builds themselves (ie the results of a build), not the build definitions. Querying build definitions was only added with 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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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