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?
Visual Studio 2012 till 2017
For MSBuild Projects (e.g. all .Net-Projects):
Click
Tools -> Options
and then selectProjects and Solutions -> Build and Run
. ChangeMSBuild project build output verbosity
toNormal
. So it will display Time Elapsed in every Solution Project it builds. But there is unfortunatily no Elapsed Time Sum over all project. You will also see the Build started TimestampFOR C/C++ Project:
Click
Tools -> Options
and then selectProjects and Solutions -> VC++ Project Settings
.Change
Build Timing
toYes
.Tools->Options->Projects and Solutions->Build and Run->
Set "MSBuild project build output verbosity" from "Minimal" to "Normal"
Menu Tools → Options → Projects and Solutions → VC++ Project Settings → Build Timing should work.
Go to Tools → Options → Projects and Solutions → Build and Run → MSBuild project build output verbosity - set to "Normal" or "Detailed", and the build time will appear in the output window.
For Visual Studio 2012 you could use the Build Monitor extension.
Do a build first and see which project is appearing first in the build output (Ctrl + Home in the output window). Right click that project → Project Properties → Compile → Build Events → Pre-build. And
echo ###########%date% %time%#############
.So every time you see build results (or during build) do Ctrl + Home in the output window. And somewhere in that area the time and date stares at your face!
Oh and you might end up adding these details to many projects as the build order can change :)
I found a better solution! ###
Tools → Options → Projects & Solutions → Build and Run → MSBuild project build output verbosity = Normal (or above Minimal). This adds the time in the beginning/top of output window. Ctrl + Home in the output window should do.
If we want to see how much time each projects take then Projects & Solutions → VC++ Project Settings → Build Timing = yes. It is applicable to all projects; "VC++" is misleading.