如何更改Team Foundation Build下MSBuild使用的生成目录? [英] How do I change the build directory that MSBuild uses under Team Foundation Build?

查看:111
本文介绍了如何更改Team Foundation Build下MSBuild使用的生成目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm getting the following error when trying to build my app using 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个字符.

C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1682,9): error MSB3554: Cannot write to the output file "obj\Release\Company.Redacted.BlahBlah.Localization.Subsystems. Startup_Shutdown_Processing.StartupShutdownProcessingMessages.de.resources". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

我的项目在我的开发机器上可以正常运行,因为源只有两个文件夹,但是TF Build似乎使用了一个很深的目录,导致目录中断.如何更改使用的文件夹?

My project builds fine on my development machine as the source is only two folders deep, but TF Build seems to use a really deep directory that is causing it to break. How do I change the folders that are used?

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

I checked the .proj file for my build that is stored in source control and found the following:

<!--  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>

如果将其存储在数据库中,该如何更改?

If this is stored in the database how do I change it?

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

Found the following blog post which may be pointing me torward the solution. Now I just need to figure out how to change the setting in the Build Agent. http://blogs.msdn.com/jpricket/archive/2007/04/30/build-type-builddirectorypath-build-agent-working-directory.aspx

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

Currently my working directory is "$(Temp)\$(BuildDefinitionPath)" but now I don't know what wildcards are available to specify a different folder.

推荐答案

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

You need to edit the build working directory of your Build Agent so that the begging path is a little smaller. To edit the build agent, right click on the "Builds" node and select "Manage Build Agents..."

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

I personally use something like c:\bw\$(BuildDefinitionId). $(BuildDefinitionId) translates into the id of the build definition (hence the name :-) ), which means you get a build path starting with something like c:\bw\36 rather than c:\Documents and Settings\tfsbuild\Local Settings\Temp\BuildDefinitionName

祝你好运

马丁.

这篇关于如何更改Team Foundation Build下MSBuild使用的生成目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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