使用TFS API使用C#

时间:2015-07-28 20:35:22

标签: c# tfs

我正在使用VS 2013 Ultimate。我需要以编程方式识别新提交的Code Review请求,取消关联相关代码并将其合并到VS中的现有项目中,然后针对生成的代码库构建和运行测试。 我认为我正在寻找的工具位于WorkItemTracking.Client或VersionControl.Client命名空间中;但我不确定。 有人能指出我对这个过程的明确解释吗?基本样本非常有用,因为它是按压缩计划进行的。

2 个答案:

答案 0 :(得分:0)

You are probably best just adding all references from the GAC that have TeamFoudation in the name, and let the compiler worry about removing ones you don't use.

Then you you start with WorkItemStore class to run your Query to get a list of Work Items.

From there you can examine the work items to get the Shelvesets.

Once you know the Shelveset you need to hop onto the VersionControlServer to be able to unshelve a Shelveset into a Workspace.

I have some basic TFS API interactions using Linqpad on my blog that I always use as a starting place.

答案 1 :(得分:0)

This sounds an awful lot like a gated checkin to me. For Git-backed projects, TFS 2015 has exactly what you want in the form of branch policies.

For what you're doing right now, I'd just use gated checkin + a code review required checkin policy.

相关问题