Redaguoti

Bendrinti naudojant


Update a legacy pipeline in Azure Pipelines

Note

This documentation does not apply to the new build pipeline, even if you run it on the build virtual machine.

An Azure Pipelines pipeline explicitly specifies the versions of Visual Studio tools such as MSBuild and VS Test. To continue supporting newer versions of these products, new virtual machines will be deployed with newer versions of Visual Studio pre-installed. Any existing pipelines need to be manually updated to use the newer version.

Determine if your pipeline needs to be updated

Build and development virtual machines deployed with version 10.0.13 through version 10.0.20 include Visual Studio 2017. Those deployed with version 10.0.21 and later include Visual Studio 2019. Support for Visual Studio 2015 was deprecated in April 2021 and support for Visual Studio 2017 was deprecated in April 2022. If your build virtual machine does not include Visual Studio 2019 you must plan to deploy a new build virtual machine with version 10.0.21 or later, or consider using the new hosted build pipeline.

If your build virtual machine has Visual Studio 2019 installed, you can use the newer versions of MSBuild and VS Test. If your pipeline was created by a virtual machine deployment prior to version 10.0.21, you will have to manually update the pipeline.

Finally, you can check your build pipeline on the Build the solution step. The MSBuild Version property indicates the version of Visual Studio in use.

MSBuild version Visual Studio version
MSBuild 14.0 Visual Studio 2015
MSBuild 15.0 Visual Studio 2017
MSBuild 16.0 Visual Studio 2019

Updating the Azure Pipelines pipeline

Note

To update an Azure Pipelines pipeline to use Visual Studio 2019, ensure your build virtual machine has been updated to version 10.0.21 or later.

The following four properties, in three tasks in the pipeline, need to be updated.

Task name Task property Old value New value
Build the solution MSBuild Version MSBuild 14.0/15.0 MSBuild 16.0
Database Sync MSBuild Version MSBuild 14.0/15.0 MSBuild 16.0
Execute Tests Test platform version Visual Studio 2015/2017 Visual Studio 2019
Execute Tests Other console options /Platform:X64 /InIsolation /UseVsixExtensions:true /Platform:X64 /InIsolation /TestAdapterPath:"$(VsixExtensionFolder)"