Today I was working at a customer who was still using Team Foundation Server 2013(!) and the XAML build feature. We are helping them to move away (finally) from this very old version and bring them to Azure DevOps Server 2022.
The migration itself went quite smoothly. We had to do an upgrade first to TFS 2015 but from there we could directly upgrade to Azure DevOps Server 2022. Great work from the team at Microsoft that created the Upgrade Wizard. I can only imagine what a challenge it was to create an upgrade process that works for so many versions.
That being said it was not yet the end of our journey because we also had to reverse engineer and migrate all XAML builds to the new task based Azure Pipelines. We decided to first migrate the builds ‘as-is’. One (small?) difference between the XAML builds and the new build system is that the XAML build puts the build output for all projects in the same folder.
How can we mimic this behavior using the newer build system?
The first thing we need to do is use the Build task to compile our solution and configure the output path. This can be done by setting the OutputPath
property:
- task: VSBuild@1 | |
displayName: Build | |
inputs: | |
solution: '$/Example/Application.sln' | |
msbuildArgs: '/p:OutputPath=$(Build.ArtifactStagingDirectory)' | |
platform: '$(BuildPlatform)' | |
configuration: '$(BuildConfiguration)' | |
clean: true |
Now we can publish the generated artifacts from this one location using the Publish Artifacts task:
steps: | |
- task: PublishBuildArtifacts@1 | |
displayName: 'Publish Artifact' | |
inputs: | |
PathtoPublish: '$(Build.ArtifactStagingDirectory)' | |
publishLocation: FilePath | |
TargetPath: '\\srv\share\' |
That did it for us!
Remark: I hope that I never need this information again as I had to re-experience the pain of using the XAML builds. Never again please!
More information
Upgrade your deployment - Azure DevOps Server & TFS | Microsoft Learn