11

The REST API Reference for VS Team Services and TFS page separates the "Build 1.0" and "Build 2.0" APIs.

It seems like such a difference also exists in the .NET API because running the following code only lists the "old" XAML build definitions and not the new ones.

var tpc = new TfsTeamProjectCollection(new Uri("http://tfsurl"));
var buildServer = tpc.GetService<IBuildServer>();
var def = buildServer.QueryBuildDefinitions("Project Name"); // Finds only XAML definitions

Is there a new DLL I can reference to write equivalent code that will work with the new TFS or is the web API all there is?

dee-see
  • 23,668
  • 5
  • 58
  • 91

1 Answers1

10

You're looking for:

 Microsoft.TeamFoundation.Build.WebApi.BuildDefinition

in:

 Microsoft.TeamFoundation.Build2.WebApi, Version=14.0.0.0

Which can be accessed through:

 Microsoft.TeamFoundation.Build.WebApi.BuildHttpClient

Simplest way to add it to your project is using the Nuget Package:

PM> Install-Package Microsoft.TeamFoundationServer.ExtendedClient
jessehouwing
  • 106,458
  • 22
  • 256
  • 341
  • 1
    Exactly what I needed, thanks! If anyone's looking for the dll on a machine where TFS is not installed, it can be found in the Microsoft Team Foundation Server 2015 Power Tools folder if you happen to have that installed. – dee-see Dec 28 '15 at 21:31
  • 2
    Best way to add it, is through the new nuget package. Microsoft.TeamFoundation.ExtendedClient – jessehouwing Dec 28 '15 at 21:33