Search code examples
.netmsbuildteamcitydatabase-project

TeamCity build step -- FAILED in MSBuild


The solution builds successfully on my machine but not on the build server. There are the project's solution

Projects within solution

This is the MSBuild output

[13:42:17][Step 2/5] MSBuild output [13:42:17][MSBuild output] Focal.Business.Library -> D:\BuildAgent\work\9d2a77191c8abcc1\Focal.Business.Library\bin\Release\Focal.Business.Library.exe [13:42:17][MSBuild output] Copying file from "obj\Release\Focal.Business.Library.pdb" to "bin\Release\Focal.Business.Library.pdb". [13:42:17][MSBuild output] Done Building Project "D:\BuildAgent\work\9d2a77191c8abcc1\Focal.Business.Library\Focal.Business.Library.csproj" (default targets). [13:42:17][MSBuild output] Project "D:\BuildAgent\work\9d2a77191c8abcc1\Focal.API.sln" (2) is building "D:\BuildAgent\work\9d2a77191c8abcc1\Focal\Focal.sqlproj" (11) on node 1 (default targets). [13:42:17][MSBuild output] CoreCompile: [13:42:17][MSBuild output] C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" /debug:pdbonly /optimize+ /out:obj\Release\Focal.dll /subsystemversion:6.00 /target:library /warnaserror- /utf8output "D:\BuildAgent\temp\buildTmp\.NETFramework,Version=v4.5.SqlClrAttributes.cs" [13:42:17][MSBuild output] SqlBuild: [13:42:17][MSBuild output] Creating a model to represent the project... [13:42:17][MSBuild output] Done Building Project "D:\BuildAgent\work\9d2a77191c8abcc1\Focal\Focal.sqlproj" (default targets) -- FAILED. [13:42:17][MSBuild output] Done Building Project "D:\BuildAgent\work\9d2a77191c8abcc1\Focal.API.sln" (default targets) -- FAILED. [13:42:17][MSBuild output] Done Building Project "D:\BuildAgent\work\9d2a77191c8abcc1\Focal.API.sln.teamcity" (TeamCity_Generated_Build target(s)) -- FAILED. [13:42:17][MSBuild output] [13:42:17][MSBuild output] Build FAILED.

The error is not too descriptive. I need help.


Solution

  • The error message is saying that your SqlProj failed to compile

    [13:42:17][MSBuild output] SqlBuild: [13:42:17][MSBuild output] Creating a model to represent the project... [13:42:17][MSBuild output] Done Building Project "D:\BuildAgent\work\9d2a77191c8abcc1\Focal\Focal.sqlproj" (default targets) -- FAILED. There are a few reasons why this might happen, but the first thing to check is if the Sql Server Data Tools (SSDT) are installed on the build server.

    If they are then check out any differnces between your "Debug" and "Release" configurations in the Visual Studio Configuration Manager