Take the 2-minute tour ×

Is there a simple and straightforward way to build many VS2008 solutions in a batch? I would like to build over 50 at once as Release, and perhaps also as Debug builds.

The trouble with just using MSBuild on the command line is that it is very difficult to find out which solutions/projects failed to build, information which is essential. Does anyone have a good suggestion?

share|improve this question

3 Answers 3

up vote 1 down vote accepted

You can call devenv (Visual Studio) from a batch file to build your project, for instance:

  devenv projectfile /rebuild release /out logfile

This will run quietly without showing the IDE. The logfile will receive the messages you normally see in the output window building from within the VS-IDE.

Returncode is 0 if the build is ok, otherwise 1.

Here is a list of all devenv command line switches

share|improve this answer
I think this is probably what we will end up doing... :) –  Joel in Gö Nov 29 '11 at 16:59

You can build all solutions using MSBuild script and specify different log files for errors or warnings only or full diagnostic log. You can use up to ten file loggers.

Define MSBuild script for building your solutions. Add all your solution files in ProjectToBuild item collection:

        <ProjectToBuild Include="a1.sln…">
        <ProjectToBuild Include="a2.sln">
    <Target Name="Build">
        <MSBuild Projects="@(ProjectToBuild)"/>

Use /flp MSBuild command line argument to specify different log files for errors, warning, and full diagnostic log.

msbuild.exe ScriptAbove.proj /filelogger /flp1:logfile=errors.txt;errorsonly /flp2:logfile=warnings.txt;warningsonly /flp3:LogFile=FullDiagnostic.log;Verbosity=diagnostic
share|improve this answer

You can call MSBuild for each solution in a batch file, redirecting the output to a file, so you can see what failed.

share|improve this answer
Yes I know, but the output is HUGE; imagine 50 projects worth... I don't want to have to wade through 50 MSBuild files to see what worked and what didn't... –  Joel in Gö Nov 29 '11 at 11:21
@JoelinGö - Still. You can always redirect the standard error to a different file. –  Oded Nov 29 '11 at 11:22

Your Answer


