【问题标题】:How do I change the build directory that MSBuild uses under Team Foundation Build?如何更改 MSBuild 在 Team Foundation Build 下使用的构建目录?
【发布时间】:2010-09-11 09:11:37
【问题描述】:

尝试使用 Team Foundation Build 构建我的应用时出现以下错误:

C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1682,9):错误 MSB3554:无法写入输出文件“obj\Release\Company.Redacted.BlahBlah.Localization .子系统。 Startup_Shutdown_Processing.StartupShutdownProcessingMessages.de.resources”。指定的路径、文件名或两者都太长。完全限定的文件名必须小于 260 个字符,目录名必须小于 248 个字符。

我的项目在我的开发机器上构建良好,因为源代码只有两个文件夹深,但 TF Build 似乎使用了一个非常深的目录,导致它崩溃。如何更改使用的文件夹?

编辑:我检查了存储在源代码管理中的构建的 .proj 文件,发现以下内容:

<!--  BUILD DIRECTORY
 This property is included only for backwards compatibility. The build directory used for a build 
 definition is now stored in the database, as the BuildDirectory property of the definition's 
 DefaultBuildAgent. For compatibility with V1 clients, keep this property in sync with the value 
 in the database.
-->
<BuildDirectoryPath>UNKNOWN</BuildDirectoryPath>

如果这是存储在数据库中,我该如何更改它?

编辑: 发现以下博客文章可能会指向我的解决方案。现在我只需要弄清楚如何更改 Build Agent 中的设置。 http://blogs.msdn.com/jpricket/archive/2007/04/30/build-type-builddirectorypath-build-agent-working-directory.aspx

目前我的工作目录是“$(Temp)\$(BuildDefinitionPath)”,但现在我不知道有哪些通配符可用于指定不同的文件夹。

【问题讨论】:

    标签: tfs msbuild tfsbuild


    【解决方案1】:

    您需要编辑您的构建代理的构建工作目录,使乞求路径更小一些。要编辑构建代理,请右键单击“构建”节点并选择“管理构建代理...”

    我个人使用 c:\bw\$(BuildDefinitionId) 之类的东西。 $(BuildDefinitionId) 转换为构建定义的 id(因此得名 :-) ),这意味着您获得的构建路径以 c:\bw\36 而不是 c:\Documents and Settings\tfsbuild\Local 之类的内容开头Settings\Temp\BuildDefinitionName

    祝你好运,

    马丁。

    【讨论】:

    【解决方案2】:

    您必须从源代码管理资源管理器中签出构建脚本文件,并用您的手肘替换路径。

    【讨论】:

    • 查看问题说明。
    • 提问者听起来像是在使用 TFS 2008。这个建议是 TFS 2005 的正确答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-21
    • 1970-01-01
    • 2016-12-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多