views:

4374

answers:

4

Our build server is taking too long to build one of our C++ projects. It uses Visual Studio 2008. Is there any way to get devenv.com to log the time taken to build each project in the solution, so that I know where to focus my efforts?

Improved hardware is not an option in this case.

I've tried setting the output verbosity (under Tools / Options / Projects and Solutions / Build and Run / MSBuild project build output verbosity). This doesn't seem to have any effect in the IDE.

When running MSBuild from the command line (and, for Visual Studio 2008, it needs to be MSBuild v3.5), it displays the total time elapsed at the end, but not in the IDE.

I really wanted a time-taken report for each project in the solution, so that I could figure out where the build process was taking its time.

Alternatively, since we actually use NAnt to drive the build process (we use Jetbrains TeamCity), is there a way to get NAnt to tell me the time taken for each step?

+15  A: 

Tools... Options... Projects and Solutions.... MSBuild project build output verbosity - set to "Detailed", and the build time will appear in the output window

Dave Moore
Prior to Visual Studio 2010, Visual C++ projects don't use MSBuild, so this setting has no effect. Works fine for other project types, though.
Roger Lipscombe
+2  A: 

Since your question involves using DevEnv from the command line, I would also suggest using MSBuild (which can build .sln files w/o modification).

msbuild /fl /flp:Verbosity=diagnostic Your.sln

msbuild /? will show you other useful options for the filelogger.

Dave Moore
+20  A: 

Tools -> Options -> Projects and Solutions -> VC++ Project Settings -> Build Timing

should work.

JesperE
One would think it's under "Build and Run", but nooooo, that would have been to simple
Andreas Bonini
If they would have put it there, someone else would have complained that it is not where they would expect it to be. The most obvious place to put it is different for different users.
JesperE
A: 

If you're stuck on VS2005 you could use the vs-build-timer plugin. At the completion of a build it shows the total time taken and a (optional) summary of each of the project durations.

Disclaimer; I wrote it. And yes, I need to create an installer...one day!

MattyT