【问题标题】:Not all TFS Build type files are getting copied并非所有 TFS 构建类型文件都被复制
【发布时间】:2010-04-14 22:48:29
【问题描述】:

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

<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 位于同一文件夹中。我想添加文件夹以包含一些测试构建目标,因为我的文件夹变得有点满和杂乱。以下说明了我的意思。

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

               Folder\
                      Test_target_1.targets
                      ....

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

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

               Folder\
                      (nothing here)

我意识到最简单的解决方法是摆脱 Folder 并将其所有内容移至 build 文件夹,但如果可能的话,我真的很想拥有 Folder。提前感谢您的帮助。

【问题讨论】:

    标签: tfs msbuild tfsbuild


    【解决方案1】:

    在 Team Build 2008 中,您需要更改构建机器上的一项设置,以使其下载构建文件夹中的子目录 - 将其添加到 TFSBuildService.exe.config 文件中:

    <!-- 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,然后重启服务。

    唯一需要注意的是,您需要记住在任何未来的构建机器上执行此操作。但是如果你忘记了,问题就很明显了。

    顺便说一下,这个设置在2010年的build options中暴露了,方便一点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-07-04
      • 2021-06-06
      • 2015-02-24
      • 2016-08-09
      • 1970-01-01
      • 2023-04-09
      • 1970-01-01
      相关资源
      最近更新 更多