Need dependency analysis output mode /v:depends
More than once I have found that I don't have the right set of "Outputs" for a Target which causes the Target to execute when it doesn't need to. As far as I can tell there isn't a good way to diagnose/debug this issue, at least not using the /verbosity output. Here is what I would like to see. Given this MSBuild project file:
<Project DefaultTargets="Foo" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Foo" Inputs="foo.c" Outputs="Debug\foo.obj">
<Copy SourceFiles="foo.c" DestinationFiles="foo.obj"/>
</Target>
</Project>
Note that this project file is broken since it will always execute the Foo target. In order to debug this I want to be able to run msbuild like so:
msbuild foo.proj /v:depends
and see this:
! msbuild foo.proj /v:depends
Microsoft (R) Build Engine Version 2.0.50215.44
[Microsoft .NET Framework, Version 2.0.50215.44]
Copyright (C) Microsoft Corporation 2005. All rights reserved.
Build started 5/23/2005 10:27:32 PM.
__
Project "C:\Temp\foo.proj" (default targets):
Target Foo:
Dependency eval of "C:\Temp\Debug\foo.obj" - file does not exist - executing target
Using "Copy" task from assembly "Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Copy"
Copying file from "foo.c" to "foo.obj".
Done executing task "Copy".
Done building project "foo.proj".
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.08Of course this could also be just part of the "detailed" output.

