TeamCity / .sqlproj with MSBuild - FAILED

It all started with the VS2017 type of slider inside TC. It failed without any errors or hints (except for the message (default targets) -- FAILED. At the solution level). I narrowed it down to .sqlproj'ects. They are not built through MSBuild, they compile fine in VS2017 on the build agent. I blamed the SSDT for this ... but I probably checked everything. This is a problem that rises to the solution level in the TC assembly:

enter image description here

I noticed that for VS2017, SSDT comes with VS setup. Installed "Workload" "Data Storage and Processing", as well as "SQL Server Data Tools" in the "Individual Components" section. I noticed on https://docs.microsoft.com/EN-US/sql/ssdt/download-sql-server-data-tools-ssdt the sentence "If you use SSDT with Visual Studio 2017, install the AS and RS components." Did this. Nothing changed. SSDT is also installed separately for previous versions.

This stack is bound, but it did not help me.

Any other ideas?


I took a step forward. In addition to VS, Build Tools are also installed in the build agent, and the TeamCity runner for VS2017 explicitly uses MSBuild from Build tools. As you can see above, I also reproduced the issue with MSBuild from Build Build. If I select the β€œversion” of MSBuild VS2017, it works like a charm (as in VS). To make it short:

DOES NOT WORK

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin

WORKS

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin

+8
visual-studio-2017 msbuild teamcity database-project ssdt
source share
1 answer

I found a blog post from Lukie Briner , his last paragraph pointed me to a solution (thank you, buddy!).

I still don’t know why / how this can happen, perhaps this is due to the installation order of Build Tools, SSDT, Visual Studio, etc.

Reason: SSDT was missing from the build tools and its version of MSBuild.

What I've done:

Copy the SSDT folder from

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0

to

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0 .

WOW! Finally, I see the REAL message:

build-tools-msbuild-error-message

Now I had to copy SQLDB and SQLEditor (I think SQLCommon already existed in the destination folder, if it also should not be copied) from

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\Microsoft

to

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\Extensions\Microsoft

and boom ...

success

And yes, TeamCity's VS2017 runner is also pleased with it.

+8
source share

All Articles