并非所有的TFS构建类型文件都将被复制 [英] Not all TFS Build type files are getting copied

查看:66
本文介绍了并非所有的TFS构建类型文件都将被复制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为我有多个构建,共享一些包含常见构建任务的程序集,所以我对所有构建都有一个TFSBuild.proj,并根据构建导入不同的目标,如下所示:

Because I have several builds sharing some assemblies containing common build tasks, I have one TFSBuild.proj for all builds and import different targets depending on the build, like the following:

<Project DefaultTargets="DesktopBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">

  <Import Project="Build_1.targets" Condition="'$(BuildDefinition)'=='Build_1'" />
  <Import Project="Build_2.targets" Condition="'$(BuildDefinition)'=='Build_2'" />
  <Import Project="Build_3.targets" Condition="'$(BuildDefinition)'=='Build_3'" />
</Project>

特定构建的每个目标都具有构建类型文件的常规内容,但就我而言,我还引用了程序集中的某些任务,这些任务检入到源代码管理中与TFSBuild.proj相同的文件夹中.我想添加文件夹以包含一些测试构建目标,因为我的文件夹有点满并且混乱.以下说明了我的意思.

Each target for a particular build has your usual content for a build type file, but in my case, I also reference some tasks inside assemblies checked into the same folder as TFSBuild.proj in source control. I wanted to add folders to contain some test build targets, since my folder was getting a bit full and cluttered. The following illustrates what I mean.

$(TFS project)\build\
               TFSBuild.proj
               Build_1.targets
               ...
               Assembly1.dll
               Assembly2.dll
               ...

               Folder\
                      Test_target_1.targets
                      ....

但是,当我声明构建时,我发现Test_target_1.targets和Folder中的其他文件没有被复制到构建目录中,而TFSBuild.proj和其他文件在构建的根级别中类型文件夹正在被复制.这导致我的测试版本无法引用Folder中的文件,从而导致我的版本立即失败.换句话说,

When I stated my build, however, I found that Test_target_1.targets and other files in Folder were not being copied to the build directory, while TFSBuild.proj and other files in the root level, as it were, of the build type folder were being copied. This caused my test build to not be able to reference files inside Folder, causing my build to immediately fail. In other words,

$(TFS project)\build\
               TFSBuild.proj
               Build_1.targets
               ...
               Assembly1.dll
               Assembly2.dll
               ...

               Folder\
                      (nothing here)

我知道最简单的解决方法是摆脱Folder并将其所有内容移动到build文件夹,但我真的很希望拥有Folder.感谢您的提前帮助.

I realize the simplest work-around would be to get rid of Folder and move all of its contents up to the build folder, but I would really like to have Folder if at all possible. Thanks for your help in advance.

推荐答案

在Team Build 2008中,需要更改构建计算机上的设置,以使其能够下载到构建文件夹中的子目录–将其添加到TFSBuildService. exe.config文件:

With Team Build 2008, there’s a setting on the build machine you need to change to get it to download subdirectories in the build folder – add this to the TFSBuildService.exe.config file:

<!-- ConfigurationFolderRecursionType
     Set this value to Full to get the subdirectories of the BuildType folder.  We
     put the Agilent Custom targets and tasks in subdirectories.
     -->
<add key="ConfigurationFolderRecursionType" value="Full" />

要添加它,您需要停止构建服务,编辑c:\ Program Files \ Microsoft Visual Studio 9.0 \ Common7 \ IDE \ PrivateAssemblies \ TFSBuildService.exe.config,然后重新启动服务.

To add it, you need to stop the build service, edit c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\TFSBuildService.exe.config, then restart the service.

唯一的警告是您需要记住在以后的任何构建机器上执行此操作.但是很明显,如果忘记的话,会出什么问题.

The only caveat is you need to remember to do this on any future build machines. But it's pretty obvious what the problem if you forget.

顺便说一句,此设置在2010年的构建选项中公开,这更加方便.

Incidentally, this setting is exposed in the build options in 2010, which is a little more convenient.

这篇关于并非所有的TFS构建类型文件都将被复制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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