hamishmcn
hamishmcn

Reputation: 7981

How to fix visual studio 'projects out of date' message each time I run it

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...

Upvotes: 9

Views: 27800

Answers (5)

Logicrat
Logicrat

Reputation: 4468

I had this exact problem in VS2010 after I deleted some source files that were no longer used in my project. Simply selecting "Clean Solution" from the "Build" menu and then rebuilding the solution fixed the problem for me.

Upvotes: 1

heck0fan3ngin3r
heck0fan3ngin3r

Reputation: 11

I had this problem and it turned out I had a header file added to my project but that I had deleted from the disk. Removing the non-existent header file from the fixes the behavior.

Upvotes: 1

Ruud van Gaal
Ruud van Gaal

Reputation: 149

A quicker way than John's log verbosity in Visual Studio 2013, is to open the Solution Explorer's project tree; the files which were not found won't have the little triangle in front of the filename (with which you normally can see a list of symbols in that file).

Remove those files and for me, the AlwaysCreate message went away (you only see 'AlwaysCreate' when the verbose level is set to at least 'Normal').

Upvotes: 1

Jgranth
Jgranth

Reputation: 11

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

Upvotes: 1

John Saunders
John Saunders

Reputation: 161801

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.

Upvotes: 7

Related Questions