Missing compile errors for project dependencies not found in solution?

I have a solution which contains a project (called Services) which references other projects not included in the solution file.  When I build this in Visual Studio, the build fails as expected and I have to go add the projects into the solution.  A simple case of references to projects which don't exist.

However, when the same solution is run in CI, we discovered that TeamCity does not report that a project is missing from the solution and instead locates the project from the repository and compiles it anyway.  Looking thru verbose log output doesn't say much, but it seems that the TeamCity_Generated_Build target must have some way to know about traversing these dependency references and building them anyway.

Details which may or may not be relevant:

  1. TeamCity wipes it's local repository and pulls a fresh copy of the full repository from Mercurial before every build.
  2. TeamCity then loads our NuGet packages (which pulls all packages for all projects, even those not being built).
  3. TeamCity then uses the Visual Studio (sln) runner to build the solution.

Currently using TeamCity v8.0.3... but I'd need proof that this is changed in a newer version before I can take upgrading seriously.


I am looking for a way to tell TeamCity to stop building projects not explicitly included in the solution file and instead throw compile errors for missing projects.  Does anyone know how TeamCity is accomplishing this?  And... is there a way to turn this behavior off in TeamCity that we've somehow managed to turn on?



1 comment
Comment actions Permalink

Hello Tim,

Could you please try to use MSBuild runner to run your solution? What is the result? What is the result if you run the build via command line on agent machine using MSBuild.exe? Please investigate the issue using the guidelines and provide us with additional information: logs, screenshots.


Please sign in to leave a comment.