I have a single pipeline in azure containing two stages: one for building and one for testing:
trigger:
- main
stages:
- stage: 'Checkout'
jobs:
- job: 'x86'
timeoutInMinutes: 60
pool: <mypool>
steps:
- checkout: self
lfs: true
- stage: 'CompileAndTest'
jobs:
- job: 'UnitTests'
timeoutInMinutes: 60
pool: <mypool>
steps:
- task: MSBuild@1
inputs:
solution: '$(Build.SourcesDirectory)/MyAssembly.csproj'
platform: 'x86'
configuration: 'Debug'
When executing that pipeline, stage Checkout
will first checkout the code to $(Build.SourceSirectory)
, which in my case resolved to D:\agents\build\_work\3\s
.
Afterwards the stage CompileAndTest
compiles the code. However MSBuild states
error MSB1009: project not found, project 'D:\agents\build\_work\4\s\MyAssembly.csproj'
So the variable Build.SourceDirectory
resolves to different locations between the two stages.
My pool only has a single agent, so I'm sure both jobs run on the same agent.