How does msbuild determine whether a project should be built?

I'm trying to figure out what msbuild does exactly to figure out whether a project should be built or not, because it seems that projects that haven't changed, are not built. Does it use the obj directory or the compiled assemblies in any way?
[258 byte] By [beefeater] at [2007-12-24]
# 1

MSBuild will always build a project. However it may not build all of the targets inside of the project. This will depend on whether or not the outputs produced by the targets are up to date with respect to the inputs.

When MSBuild builds a project it will compare the inputs of the targets with the outputs of the targets based on the timestamp of these inputs and outputs. If the inputs are newer then the outputs then the target will build.

This partial building of a project is called incremental build. Here is a link to the msdn site which explains how incremental build works:

http://msdn2.microsoft.com/en-us/library/ms171483.aspx

ChrisMann at 2007-10-8 > top of Msdn Tech,Visual Studio,Visual Studio MSBuild...
# 2

Note that GenerateResource works a little differently -- the task itself does the timestamp comparision.

To see why MSBuild chose to build or not, build with diagnostic verbosity (/v:diag) and look at the log

DanMoseley-MSFT at 2007-10-8 > top of Msdn Tech,Visual Studio,Visual Studio MSBuild...
# 3
Do any of you know how to determine whether a given file needs to be built using the extensibility model (without compiling first). I've been searching high and low for this info and am starting to think it can't be done using conventional means. If anyone can shed some light on the situation it would be greately appreciated. Thanks very much.
LarrySmith999999 at 2007-10-8 > top of Msdn Tech,Visual Studio,Visual Studio MSBuild...

Visual Studio

Site Classified