Search code examples
c#visual-studio-2015projects-and-solutions

Building a large solution with multiple dependencies fails unless built manually


I have a faily large solution with 56 projects. Sometimes, when cloning the repo to a new work area and rebuilding from scratch, I get weird problems.

It goes like this:

I load the checked out solution file, and get about 20 stacked dialog-boxes that want me to restore NuGet-libraries. Fine, I do that (but laugh a little about the stacked dialogs)

I do Build-Clean Solution

I do Build-Build Solution

I get 63 Errors of type CS0006 Metadata "MySolution\MyProject\bin\Debug\MyProj.dll" could not be found. About 4-5 DLLs are referenced in these errors.

I then build these "by hand" by right-clicking and doing rebuild, and ultimately I can build the whole project. Obviously, there are some dependency problems, but how can I investigate it since it is supposed to work "automagically"? I would almost prefer to create the build file myself....

Any ideas?


Solution

  • Turns out the project (not mine!) was missing Build Dependencies between projects. Apparently I don't fully understand the dependency management (have switched from Java to C# this year), I thought it was more automatic, since I could do "using"-statements without problem I though dependency was setup, but in some cases they were missing. I will investigate this further later on, but for now its is enough that I know that I will have to check each error by itself and verify with the Build settings.