none
Why is it Compiling... RRS feed

  • Question

  • QWuite often I find that many projects in my solutions are getting re-compiled when there is no apparent reason. This triggers an avalanche of additional compiles and results in Build times of 15+ minutes.

     

    Is there ANY way to see WHY a specific project is going to be re-compiled??????

    Wednesday, November 7, 2007 1:59 PM

Answers

  • If you call msbuild with /verbosityBig Smileiagnostic then it spews loads of debug info, among other things how the conditions were evaluated. This might be helpful, although you get somewhat of a needle in the haystack feeling when trawling through loads of output...

     

    Thursday, November 8, 2007 7:23 AM

All replies

  • The obvious reason is the inter-project dependencies (either as .NET assembly, COM interop or C++ lib). You can build only single project, which will result in dependencies being verified (or built if out of date).

     

    What kind of projects you are building?

     

    Regards, Eugene

     

    Wednesday, November 7, 2007 4:52 PM
  • I have a solution with 100+ .csproj files. Most are control libraries, some are executables.

     

    The problem is Visual Studio will decide that a very primitive library (one with NO dependancies) needs to be build. The act of creating a new version of this ssemble forces all of the dependant projectsw to re-compile.

     

    The question I have is how to determine WHY the original primitive library re-compiles...

    Wednesday, November 7, 2007 6:15 PM
  • Are you sure that the actual recompilation happens? VS has a funny way of checking the assembly for the date, so that it appears in log as if it was updated.

    Is the actual call to Csc.exe made?

     

    And another thing to check would be to make sure that the primitive assembly file does not get modified somehow in the build process; namely - if you do build on that project only two times one after another, does it get recompiled?

     

    Regards, Eugene

    Wednesday, November 7, 2007 7:10 PM
  • Yes, I am sure. And I KNOW that one of the dependancies has been marked as updated. The point is that with a few hundred inter-related dependancies it is almost impossible to figure out which one is triggering the build.

     

    Most "Make" progreams have a switch that display all of the criteria as theyu are evaluated and can display the specific item that is going to trigger the actual build. This is the functionallity that I am looking for, so that either as a discrete operation or as part of the build I get some type of message stating specifically what dependancy is the one that is triggering the re-compilation.

     

     

    Thursday, November 8, 2007 12:51 AM
  • If you call msbuild with /verbosityBig Smileiagnostic then it spews loads of debug info, among other things how the conditions were evaluated. This might be helpful, although you get somewhat of a needle in the haystack feeling when trawling through loads of output...

     

    Thursday, November 8, 2007 7:23 AM
  • Simon,

     

    That sounds exactly like what I am looking for (and I am prepared for "Information Overload"). Just out of curiosuty can I invoke MSBuild this way from within VS-2008 (Orcas). I know that VS-2008 controls the order of project builds based on the dependancies......

    Thursday, November 8, 2007 2:09 PM
  • I think that the verbosity flag related settings did not change in Orcas (it certainly still uses MSBuild engineSmile. Additionally, VS2005 also determines the build order based on dependencies set.

     

    Cheers, Eugene

    Thursday, November 8, 2007 5:08 PM
  • Don't have a vs2008 in handy right now, but in VS2005 you do can change this by going to:

    Tools->Options->Projects And Solutions->Build and Run->"MSBuild project build output verbosity" combo box

    I'd expect that VS2008 haven't changed *that* much in this regard, so I'm hoping the above will be helpful.

    Thursday, November 8, 2007 5:46 PM