是否有一个.NET API相当于"建设2.0" REST API的TFS 2015年? [英] Is there a .NET API equivalent to the "Build 2.0" REST API for TFS 2015?

查看:212
本文介绍了是否有一个.NET API相当于"建设2.0" REST API的TFS 2015年?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关VS团队服务和TFS 页面的 REST API参考分离建设1.0和建设2.0的API。

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

这似乎是这种差异也存在于.NET API,因为运行下面的代码只列出了老XAML构建定义和,而不是新的

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

有一个新的DLL我可以参考编写等效代码,将工作新TFS或者是Web API的所有有

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?

推荐答案

您正在寻找的:

 Microsoft.TeamFoundation.Build.WebApi.BuildDefinition

 Microsoft.TeamFoundation.Build2.WebApi, Version=14.0.0.0

可通过访问:

 Microsoft.TeamFoundation.Build.WebApi.BuildHttpClient

将它添加到你的项目的最简单方法使用的NuGet包:

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

PM> Install-Package Microsoft.TeamFoundationServer.ExtendedClient

这篇关于是否有一个.NET API相当于&QUOT;建设2.0&QUOT; REST API的TFS 2015年?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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