如何更改MSBuild在Team Foundation Build下使用的构建目录?

Luk*_*uke 8 msbuild tfs tfsbuild

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

C:\ WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1682,9):错误MSB3554:无法写入输出文件"obj\Release\Company.Redacted.BlahBlah.Localization.Subsystems. 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>
Run Code Online (Sandbox Code Playgroud)

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

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

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

Mar*_*ard 16

您需要编辑Build Agent的构建工作目录,以使请求路径稍微小一些.要编辑构建代理,请右键单击"构建"节点,然后选择"管理构建代理..."

我个人使用类似c:\ bw\$(BuildDefinitionId)的东西.$(BuildDefinitionId)转换为构建定义的id(因此名称:-)),这意味着你得到一个以c:\ bw\36而不是c:\ Documents and Settings\tfsbuild\Local开头的构建路径设置\ TEMP\BuildDefinitionName

祝好运,

马丁.