views:

1559

answers:

2

I have a visual studio (2005) solution file with 70 projects.
Each time I press F5 to run it, it tells me that 4 of the projects are out of date, and asks me if I want to rebuild them. It does this even though I have just done a full build.
I understand (in principle) that one of the other projects must update something that these projects depend on, but how do I go about finding out what?

Are there any tools to help, or what procedure should I follow to figure out what is causing VS to flag these projects for a rebuild?

UPDATE:
For those interested it looks like my PC was/is the problem (my HD has been acting up recently). As I tried to track down the problem successive rebuilds started generating compile errors. I did a clean-and-build and got a huge number of (obviously spurious) errors. One reboot later, followed by a rebuild, all the errors and the dependency problem have gone away.
Excuse me now, while I go and back-up all my important files...

+2  A: 

I would run a normal Build, twice in a row. The second time, I'd set the MSBUILD verbosity to "Normal" or higher (in Tools->Options, "Projects and Solutions", "Build and Run". I'd read the output carefully to see what gets actually built the second time.

In fact, now that I think of it, if this really is a cycle, then some part of what gets built the second time must be what's causing it to build the third time, etc. Perhaps you have a post-build step in one of the projects that touches an assembly or other resource used as input to an earlier step. With 70 projects in the solution, something like this would be easy to cause inadvertently, and hard to catch. You may have to learn enough about MSBUILD to be able to detect when one of its steps is deciding it needs to build because something changed, then to understand your solution well enough to know that nothing should have changed; then to see that something has changed that should not have changed.

When you're done with this exercise, you may have gained some insight that will enable you to help in breaking the solution into smaller solutions.

John Saunders
+1  A: 

I had the same problem with linking a .netmodule into my project that was complied with a custom build step. The prolem turned out to be that I was also linking a C++ lib and the .netmodule file was listed on the same line in the linker input.

Example: .lib .netmodule

Insead of: .lib \n .netmodule

Jgranth