如何使用c#API移动TFS文件? [英] How do I move a TFS file with c# API?

查看:89
本文介绍了如何使用c#API移动TFS文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于如何使用TFS API使用c#移动文件,我已经进行了很长时间的搜索.想法是要有一个文件夹,开发人员可以在该文件夹上放下数据库升级脚本,然后将构建过程移至该文件夹,以创建一个构建脚本,并将该文件夹上的所有文件移动到具有我们刚刚创建的数据库构建版本的新文件夹中.

I have been googling for a good time on how to move a file with c# using the TFS API. The idea is to have a folder on which the developers drop database upgrade scripts and the build process get's to the folder creates a build script and moves all the files on the folder to a new folder with the database build version that we just created.

我无法认真地找到有关在TFS中以编程方式移动文件的任何参考...(除了cmd命令行)

I cannot seriously find any reference about moving files programatically in TFS... (aside of the cmd command line)

有人知道通过c#学习TFS源代码控制文件的好指南/msdn起点吗?

does anybody know of a good guide / msdn starting point for learning TFS source control files manipulation via c#?

推荐答案

非常简单:).

Microsoft.TeamFoundation.VersionControl.Client.Workspace workspace = GetMyTfsWorkspace();
workspace.PendRename( oldPath, newPath );

那么您当然需要CheckIn.使用"workspace.GetPendingChanges()"和"workspace.CheckIn()"方法进行操作.

Then you need CheckIn it of course. Use a "workspace.GetPendingChanges()" and "workspace.CheckIn()" methods to do it.

这篇关于如何使用c#API移动TFS文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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