Visual Studio生成任务-TFS操作 [英] Visual Studio Build Tasks - TFS Operations

查看:84
本文介绍了Visual Studio生成任务-TFS操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望扩展一些后期构建任务,以包括检出然后检入DLL的功能.我们正在使用TFS,我知道有命令行工具可以执行此操作.我不知道该怎么做,就是将它们集成到我现有的构建后任务中.现在,我的后期构建任务很简单,并且可以通过Visual Studio中的项目属性进行管理.最终,我想将自定义构建任务分解为外部文件并调用它们,但这是另一个问题;)

I'm looking to extend some post build tasks to include the checking out and then checking in of a DLL. We are using TFS and I know there are command line tools to do this. What I don't know how to do is to integrate these into my existing post build tasks. Right now my post build tasks are simple and are managed in Visual Studio through the project properties. Eventually I want to break out my custom build tasks into external files and call them in, but that is the subject of another question ;)

推荐答案

在不诉诸自定义生成任务的情况下,您可以尝试使用

Without resorting to custom Build tasks you could try to use the Team Foundation Source Control Command-Line tool (tf.exe).

下面的示例显示了如何使用tf.exe从TFS中检出文件.

The example below shows how to use tf.exe to check out a file from TFS.

<PropertyGroup>
    <TfCommand>
        &quot;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\tf.exe&quot;
    </TfCommand>
</PropertyGroup>

<Target Name="AfterCompile">
    <Exec Command="$(TfCommand) get /force /noprompt &quot;$(SolutionRoot)\sources\example.cs&quot;"
        ContinueOnError="true" />
    <Exec Command="$(TfCommand) checkout &quot;$(SolutionRoot)\sources\example.cs&quot;"
        ContinueOnError="true"/>
</Target>

将此包含在您自己的MSBuild项目文件中.

Include this in your own MSBuild project file.

该示例没有做任何有用的事情,您需要对其进行更改以使其与环境相匹配,但是也许它可以为您提供一个开始.

This example doesn't do anything useful and you need to change it to match your environment, but maybe it gives you a start.

我从 tfsbuild.com 中获得了这个示例.

I got this example from tfsbuild.com.

这篇关于Visual Studio生成任务-TFS操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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