0

We have a TFS 2015 build server running the new Agent in Agent Pool.

Also we have a solution with three MS SQL database projects. One of these projects has references to another two.

When I build this solution in Visual Studio 2015 on my PC, the resulting model.xml includes all views with references through [$(DBName)] variables.

However, when I run the build on TFS, all objects with external references disappear from model, thus they cannot be found in .dacpac file and as result, we cannot do a deployment.

Could someone give a hint how to solve this issue?

1 Answers1

0
  1. Log on your build agent machine, and check the output of the TFS build to see whether the structure is the same as local build. Also, try to use MSBuild command line to build the solution manually on your build agent machine to see what result will you get.

  2. It seems you reference output assemblies from one project. Instead of referencing output assemblies, it's suggested to make a project reference or create a NuGet package.

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • 1. Already checked this. The build output indeed differs, the model.xml is not including any objects with external references. I tried the MSBuild step instead of Visual Studio step in TFS build definition with the same result. 2. No, I am referencing the Database through "Add database reference...". – Dennis Belevantsev Dec 09 '16 at 09:03
  • Sorry, I mean please log on your build agent machine, and use MSBuild command line manually to build your solution to see whether you have the same result. – Cece Dong - MSFT Dec 09 '16 at 09:18
  • Tried to run a msbuild from developer's command line on build machine. Same result, no objects with external references in the model.xml. Same msbuild command ran on my PC generates correct model.xml – Dennis Belevantsev Dec 09 '16 at 09:28
  • Do you mean you can't find Metadata like when you use TFS Build? I just tried on my side, VS local build output is the same as TFS VS build step. I'm using the default Visual Studio build template in TFS 2015.3. – Cece Dong - MSFT Dec 09 '16 at 09:45
  • Yes, this metadata is missing from model.xml on TFS build. And it is present on local – Dennis Belevantsev Dec 09 '16 at 09:56
  • mystery solved. For some unknown reason, the project file was not checked into the TFS. Thus, it missed the references... Ah, lack of caffeine.. – Dennis Belevantsev Dec 09 '16 at 11:16