I set up a build pipeline on my SQL Server database repository and I am using Visual Studio 2022.
My build pipeline failed to run with the error below:
##[error]C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(573,5): Error MSB4181: The "SqlBuildTask" task returned false but did not log an error.
It has picked up the MSBuild.exe from the Visual Studio 2019 path instead of from Visual Studio 2022.
To fix this, set the Agent Specification to windows-2022, instead of windows-latest.
If you are using Microsoft-hosted agent windows-latest or windows-2022, with your task, it will use VS2022 by default. If you’d like to use VS2019, change the agent to “Windows-2019”.
Leave a comment