For a build server, we need a headless install of SQL Server Data Tools, for Visual Studio 2017.
Our build servers already have "Build Tools for Visual Studio 2017", which provides nice support for headless builds. But any solutions with SSDT projects fail due to missing MSBuild targets, eg:
[MSBuild] src\Database\Upfront.Database.sqlproj: Build default targets
[10:27:46][src\Database\Upfront.Database.sqlproj] E:\BuildAgent\work\7769fbf76d8b9008\src\Database\Upfront.Database.sqlproj(56, 3): error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
First, I tried modifying the set of components installed by "Build Tools for Visual Studio 2017", but no SSDT components appear to be available.
Second, I tried installing SSDT for Visual Studio 2017, which didn't seem to install correctly into the "Build Tools for VS 2017" profile. It does allow me to create a new VS 2017 profile, eg SQL, so the required MSBuild files are installed under C:\Program Files (x86)\Microsoft Visual Studio\2017\SQL\
; however it alters my msbuild environment variables so that "Build Tools for VS 2017" files (which are in C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools
) aren't found, resulting in C# projects being un-buildable.
It seems that "SSDT for Visual Studio 2017" and "Build Tools for Visual Studio 2017" aren't compatible with each other. Has anyone been able to get them to work together? Or has anyone found a better way to build SSDT projects on build servers?
SSDT has been pretty great, except the build server support, which is a pain every time.