简体   繁体   中英

Issue with Buld Pipeline in DevOps with Self Hosted Agent

My Team and I have researched this at great lenght and we cannot figure out why our Build in Azure DevOps Pipeline does not download any source code to the self hosted Agent running the build.

We have a project called "ProjWindowsService", a normal .NET Windows Service project using Topshelf.

We have the source code checked into the Repo in DevOps, the project is mapped in the Build Pipline but once agent runs the build job it cant find the source files and gives the error:

MSBUILD: MSBUILD : error MSB1009: Project file does not exist.
Switch: c:\it\agent\4\s\XXXXXX.API.Integration.Domain\XXXXX.API.Integration.Domain.sln

Basically there is nothing under the c:\it\agent\4\s on the agent (our understanding is that the source files should be copied to this location) except for the $tf which in itself has no files.

So the error message makes perfect sense, but we have selected and tried in multiple ways to configure the Source part of the Build Pipline without any success.

Build Pipline Source Would really appreciate some help in figuring out why the source code is not being downloaded to agent working folder.

Get Source Log:

##[command]tf vc workspace /delete ws_4_15%3Bccb20099-639d-42db-a116-f6f52fecd57d /collection:https://XXXXXX.visualstudio.com/ /loginType:OAuth /login:.,*** /noprompt

##[command]tf vc workspace /new /location:local /permission:Public ws_4_15 /collection:https://XXXXX.visualstudio.com/ /loginType:OAuth /login:.,*** /noprompt

##[command]tf vc workfold /unmap /workspace:ws_4_15 $/ /collection:https://XXXXX.visualstudio.com/ /loginType:OAuth /login:.,*** /noprompt

##[command]tf vc workfold /map /workspace:ws_4_15 "$/XXXXX Software Test" C:\IT\WorkFolder\4\s\$(Agent.BuildDirectory) /collection:https://XXXXX.visualstudio.com/ /loginType:OAuth /login:.,*** /noprompt

##[command]tf vc get /version:2 /recursive /overwrite C:\IT\WorkFolder\4\s /loginType:OAuth /login:.,*** /noprompt
##[debug]Starting process:
##[debug]  File name: 'tf'
##[debug]  Arguments: 'vc get /version:2 /recursive /overwrite C:\IT\WorkFolder\4\s /loginType:OAuth /login:.,*** /noprompt'
##[debug]  Working directory: 'C:\IT\WorkFolder\4\s'
##[debug]  Require exit code zero: 'True'
##[debug]  Encoding web name: windows-1252 ; code page: '1252'
##[debug]  Force kill process on cancellation: 'False'
##[debug]  Redirected STDIN: 'False'
##[debug]  Persist current code page: 'False'
##[debug]  Keep redirected STDIN open: 'False'
##[debug]  High priority process: 'False'
##[debug]OOM score adjustment is Linux-only.
##[debug]Process started with process id 20656, waiting for process exit.
All files are up to date.
##[debug]STDOUT/STDERR stream read finished.
##[debug]STDOUT/STDERR stream read finished.
##[debug]Finished process 20656 with exit code 0, and elapsed time 00:00:01.9414527.

The get sources log says the code is available in 'C:\IT\WorkFolder\4\s' but the build step you describe seems to try building solutions under c:\it\agent\3\s so the build and get sources steps are not working in the same directory.

Check the build step to make sure you use the same path variable.

What does your build step configuration look like?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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