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

天涯浪子 提交于 2019-12-20 13:26:56

问题


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


回答1:


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.




回答2:


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




回答3:


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




回答4:


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.




回答5:


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.



来源:https://stackoverflow.com/questions/909533/how-to-fix-visual-studio-projects-out-of-date-message-each-time-i-run-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!