在TFS 2017中创建构建代理时,工作文件夹应该是什么?

时间:2018-02-01 12:59:22

标签: tfs continuous-integration azure-devops tfsbuild

我在TFS上创建了一个构建代理,并保持工作文件夹的默认值,即_work。构建失败,因为它不包含项目文件。使用默认工作文件夹应该怎么做?

使用Visual Studio Build构建定义:

enter image description here

2018-02-02T06:02:04.6000428Z ##[section]Starting: Build
2018-02-02T06:02:04.6020618Z Current agent version: '2.122.1'
2018-02-02T06:02:06.5920856Z ##[section]Starting: Initialize Job
2018-02-02T06:02:06.5990706Z Prepare build directory.
2018-02-02T06:02:06.7466794Z Set build variables.
2018-02-02T06:02:06.7501818Z Download all required tasks.
2018-02-02T06:02:06.8317393Z ##[section]Finishing: Initialize Job
2018-02-02T06:02:06.8702795Z ##[section]Starting: Get Sources
2018-02-02T06:02:06.9518235Z Prepending Path environment variable with directory containing 'tf.exe'.
2018-02-02T06:02:06.9523242Z Setting environment variable TFVC_BUILDAGENT_POLICYPATH
2018-02-02T06:02:06.9523242Z Querying workspace information.
2018-02-02T06:02:10.7127112Z ##[command]tf vc workspace /new /location:local /permission:Public ws_2_4 /collection:http://arapl-tfsserver:8080/tfs/RiskAnalytics/ /loginType:OAuth /login:.,******** /noprompt
2018-02-02T06:02:13.6192162Z ##[command]tf vc workfold /unmap /workspace:ws_2_4 $/ /collection:http://arapl-tfsserver:8080/tfs/RiskAnalytics/ /loginType:OAuth /login:.,******** /noprompt
2018-02-02T06:02:15.4369337Z ##[command]tf vc workfold /map /workspace:ws_2_4 $/ARA C:\agent\_work\2\s /collection:http://arapl-tfsserver:8080/tfs/RiskAnalytics/ /loginType:OAuth /login:.,******** /noprompt
2018-02-02T06:02:17.2476000Z ##[command]tf vc workfold /cloak /workspace:ws_2_4 $/ARA/Drops /collection:http://arapl-tfsserver:8080/tfs/RiskAnalytics/ /loginType:OAuth /login:.,******** /noprompt
2018-02-02T06:02:19.2651239Z ##[command]tf vc get /version:1 /recursive /overwrite C:\agent\_work\2\s /loginType:OAuth /login:.,******** /noprompt
2018-02-02T06:02:20.4355458Z All files are up to date.
2018-02-02T06:02:20.4640653Z ##[section]Finishing: Get Sources
2018-02-02T06:02:20.4705702Z ##[section]Starting: Build solution $/ARA/Mainline/CommonBuildProject.proj
2018-02-02T06:02:20.4860808Z ==============================================================================
2018-02-02T06:02:20.4860808Z Task         : MSBuild
2018-02-02T06:02:20.4860808Z Description  : Build with MSBuild
2018-02-02T06:02:20.4860808Z Version      : 1.119.0
2018-02-02T06:02:20.4860808Z Author       : Microsoft Corporation
2018-02-02T06:02:20.4860808Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613724)
2018-02-02T06:02:20.4860808Z ==============================================================================
2018-02-02T06:02:23.0868381Z ##[command]"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" "C:\agent\_work\2\s\Mainline\CommonBuildProject.proj" /nologo /nr:false /t:"Clean" /dl:CentralLogger,"C:\agent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.119.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=|SolutionDir=C:\agent\_work\2\s\Mainline"*ForwardingLogger,"C:\agent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.119.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /t:build /p:Configuration=Release /p:Platform="Any CPU" /p:ReleaseFolder=C:\TFSBuild\Release\ /p:_MSDeployUserAgent="TFS_8fa5b373-d497-4249-be41-399e5ed666ac_build_6_275"
2018-02-02T06:02:23.2459495Z MSBUILD : error MSB1009: Project file does not exist.
2018-02-02T06:02:23.2459495Z Switch: C:\agent\_work\2\s\Mainline\CommonBuildProject.proj
2018-02-02T06:02:23.4706080Z ##[error]Process 'msbuild.exe' exited with code '1'.
2018-02-02T06:02:23.4776130Z ##[command]"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" "C:\agent\_work\2\s\Mainline\CommonBuildProject.proj" /nologo /nr:false /dl:CentralLogger,"C:\agent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.119.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=|SolutionDir=C:\agent\_work\2\s\Mainline"*ForwardingLogger,"C:\agent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.119.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /t:build /p:Configuration=Release /p:Platform="Any CPU" /p:ReleaseFolder=C:\TFSBuild\Release\ /p:_MSDeployUserAgent="TFS_8fa5b373-d497-4249-be41-399e5ed666ac_build_6_275"
2018-02-02T06:02:23.6242159Z MSBUILD : error MSB1009: Project file does not exist.
2018-02-02T06:02:23.6247162Z Switch: C:\agent\_work\2\s\Mainline\CommonBuildProject.proj
2018-02-02T06:02:23.6452310Z ##[error]Process 'msbuild.exe' exited with code '1'.
2018-02-02T06:02:23.6787543Z ##[section]Finishing: Build solution $/ARA/Mainline/CommonBuildProject.proj
2018-02-02T06:02:23.6852592Z ##[section]Starting: Post Job Cleanup
2018-02-02T06:02:23.6922638Z ##[section]Finishing: Post Job Cleanup
2018-02-02T06:02:23.7012701Z ##[section]Finishing: Build

1 个答案:

答案 0 :(得分:0)

配置构建代理时,可以使用默认的工作文件夹路径。对构建进行排队时,构建代理将获取工作文件夹的源。

您遇到的错误似乎没有在构建定义中映射工作区。如截图所示,请转到Get sources - Workspace mappings检查您的构建定义,并确保已映射了您要构建的项目。

enter image description here