简体   繁体   English

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

[英]What should be the working folder while creating a build agent in TFS 2017?

I created a build agent on the TFS and kept the working folder default ie _work. 我在TFS上创建了一个构建代理,并将工作文件夹保留为默认值,即_work。 The build fails as it contains no project file. 该构建失败,因为它不包含任何项目文件。 What should be done to use the default working folder? 使用默认工作文件夹应该怎么做?

The Build definition with Visual Studio Build: 使用Visual Studio Build的Build定义:

在此处输入图片说明

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

You can use the default working folder path when you config a build agent. 配置构建代理时,可以使用默认的工作文件夹路径。 When you queue builds, build agent will get sources to the working folder. 当您对构建进行排队时,构建代理会将源获取到工作文件夹。

The error you got seems you did not map workspace in your build definition. 您收到的错误似乎是您没有在构建定义中映射工作空间。 Please check your build definition by going to Get sources -- Workspace mappings as the screenshot shows, and make sure you have mapped the project you want to build. 如截图所示,请转到Get sources - Workspace mappings ,检查构建定义,并确保已映射要构建的项目。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM