1

Is there a way to force Visual Studio to provide a report of why it thinks it needs to rebuild a given target, without actually doing the build? This would be similar in concept to GNU Make's -n option to disable actual building, plus the -d option for dumping out what is considered out-of-date. If the build is allowed to execute and modify files, then the modification timestamps on the files will of course change, thus hampering efforts to find exactly where the problem lies (i.e., more files are rebuilding than is deemed necessary).

I would prefer a report in text file format (or HTML) so that I can save it and use it as reference later.

This is using VS2010SP1, but I would expect a solution to also work for VS2010.

Edit #1: Seeing as how this really and truly should be a feature of the core compiler toolchain, I cross-posted a similar question into social.msdn.microsoft.com How to get Visual Studio 2008 to show what it considers out of date without rebuilding.

Edit #2: As a followup to social.msdn.microsoft.com post, I posted an enhancement request to Microsoft Connect that does not look like it will be implemented any time soon. See provide-textual-report-showing-what-visual-studio-considers-out-of-date-without-rebuilding

Related questions:

  1. How to fix visual studio 'projects out of date' message each time I run it
  2. Why is Visual Studio 2008 always rebuilding my whole project?:
Community
  • 1
  • 1
bgoodr
  • 2,744
  • 1
  • 30
  • 51

1 Answers1

1

You can use the tool NDepend for that. If a source file has a Last Modified date higher than the assembly PDB file Last Modified date, NDepend will emit a warning:

WARNING: The source file {C:\Dir\SourceFile.cs} (last modified 11/03/2011 08:36:42) and the PDB file of the assembly {AssemblyName} (last modified 10/03/2011 18:06:53) are not in-sync.

Patrick from NDepend team
  • 13,237
  • 6
  • 61
  • 92
  • NDepend is a trialware addon apparently. However, I need a way that is built into Visual Studio, or is a methodology I can deploy readily on top of an existing Visual Studio that is not trailware. – bgoodr Mar 11 '11 at 19:27