Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build Multiple Visual Studio Solutions Simultaneously

I have seen a few semi-related questions, but nothing that hits this on the head:

How can I build multiple Visual Studio projects at the same time?

The pattern is each solution contains several projects, each with several configurations. You can build all of those projects/configurations with the "Batch Build" feature.

Now I need a way to "Batch Build" several solutions at the same time (one command). My research seems to indicate that this is not directly possible. Any workarounds? I'm using VS 2013, if it matters.

like image 970
imallett Avatar asked Mar 02 '14 18:03

imallett


1 Answers

I don't believe you can build multiple solutions within a single instance of Visual Studio; only projects.

However, I use msbuild to do just that. The following was tested with Visual Studio 2013 installed.

Create master.proj file.

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <Solution Include="../**/*.sln">
      <Properties>Configuration=Debug;Platform=Any CPU</Properties>
    </Solution>
    <Solution Include="../**/*.sln">
      <Properties>Configuration=Release;Platform=Any CPU</Properties>
    </Solution>
  </ItemGroup>
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
  </PropertyGroup>
  <Target Name="Build">
    <MSBuild Projects="@(Solution)" BuildInParallel="true" Targets="Build" />
  </Target>
  <Target Name="Clean">
    <MSBuild Projects="@(Solution)" BuildInParallel="true" Targets="Clean" />
  </Target>
  <Target Name="Rebuild">
    <MSBuild Projects="@(Solution)" BuildInParallel="true" Targets="Rebuild" />
  </Target>
</Project>

We're using the batching capability of msbuild to build different configurations (Release vs Debug) and platforms with one call. You can add other properties, like the architecture.

<ItemGroup>
  <Solution Include="../**/*.sln">
    <Properties>Configuration=Debug;Platform=Any CPU</Properties>
  </Solution>
  <Solution Include="../**/*.sln">
    <Properties>Configuration=Release;Platform=Any CPU</Properties>
  </Solution>
</ItemGroup>

To see how MSBuild resolves this, try the following:

<Target Name="Build">
  <Message Text="%(Solution.Identity) -> %(Solution.Properties)" />
</Target>

You may see something like:

../ConsoleApplication1\ConsoleApplication1.sln -> Configuration=Debug;Platform=Any CPU
../ConsoleApplication2\ConsoleApplication2.sln -> Configuration=Debug;Platform=Any CPU
../ConsoleApplication3\ConsoleApplication3.sln -> Configuration=Debug;Platform=Any CPU
../ConsoleApplication1\ConsoleApplication1.sln -> Configuration=Release;Platform=Any CPU
../ConsoleApplication2\ConsoleApplication2.sln -> Configuration=Release;Platform=Any CPU
../ConsoleApplication3\ConsoleApplication3.sln -> Configuration=Release;Platform=Any CPU

In this case, the following

<Target Name="Build">
  <MSBuild Projects="@(Solution)" BuildInParallel="true" Targets="Build" />
</Target>

Is almost like writing

<Target Name="Build">
  <MSBuild Projects="../ConsoleApplication1\ConsoleApplication1.sln" BuildInParallel="true" Targets="Build" Properties="Configuration=Debug;Platform=Any CPU" />
  <MSBuild Projects="../ConsoleApplication2\ConsoleApplication2.sln" BuildInParallel="true" Targets="Build" Properties="Configuration=Debug;Platform=Any CPU" />
  <MSBuild Projects="../ConsoleApplication3\ConsoleApplication3.sln" BuildInParallel="true" Targets="Build" Properties="Configuration=Debug;Platform=Any CPU" />

  <MSBuild Projects="../ConsoleApplication1\ConsoleApplication1.sln" BuildInParallel="true" Targets="Build" Properties="Configuration=Release;Platform=Any CPU" />
  <MSBuild Projects="../ConsoleApplication2\ConsoleApplication2.sln" BuildInParallel="true" Targets="Build" Properties="Configuration=Release;Platform=Any CPU" />
  <MSBuild Projects="../ConsoleApplication3\ConsoleApplication3.sln" BuildInParallel="true" Targets="Build" Properties="Configuration=Release;Platform=Any CPU" />
</Target>

Doing the latter isn't exactly the same. For example, the solutions will be built in serial, while the projects within those solutions will be built in parallel. But it gives you the idea of how batching works.

Here's the one command to build all the "Debug" and "Release" configurations.

msbuild master.proj /m:4 /ds 

To ensure solutions (and not only their projects) are built in parallel, /m is required. The /ds will give you a detailed summary, so you can see whether its working or not.

The output on my machine is as follows:

Microsoft (R) Build Engine version 4.0.30319.33440
[Microsoft .NET Framework, version 4.0.30319.34011]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 3/2/2014 12:56:38 PM.
     1>Project "S:\msbuild\parallel\ConsoleApplication1\master.proj" on node 1 (default targets).
     1>Project "S:\msbuild\parallel\ConsoleApplication1\master.proj" (1) is building "S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1.sln" (2) on node 1 (Build target(s)).
     2>ValidateSolutionConfiguration:
         Building solution configuration "Debug|Any CPU".
     1>Project "S:\msbuild\parallel\ConsoleApplication1\master.proj" (1) is building "S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2.sln" (3) on node 1 (Build target(s)).
     3>ValidateSolutionConfiguration:
         Building solution configuration "Debug|Any CPU".
     1>Project "S:\msbuild\parallel\ConsoleApplication1\master.proj" (1) is building "S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3.sln" (4) on node 1 (Build target(s)).
     4>ValidateSolutionConfiguration:
         Building solution configuration "Debug|Any CPU".
     1>Project "S:\msbuild\parallel\ConsoleApplication1\master.proj" (1) is building "S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1.sln" (2:2) on node 1 (Build target(s)).
     2>ValidateSolutionConfiguration:
         Building solution configuration "Release|Any CPU".
     1>Project "S:\msbuild\parallel\ConsoleApplication1\master.proj" (1) is building "S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2.sln" (3:2) on node 1 (Build target(s)).
     3>ValidateSolutionConfiguration:
         Building solution configuration "Release|Any CPU".
     1>Project "S:\msbuild\parallel\ConsoleApplication1\master.proj" (1) is building "S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3.sln" (4:2) on node 1 (Build target(s)).
     4>ValidateSolutionConfiguration:
         Building solution configuration "Release|Any CPU".
     2>Project "S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1.sln" (2) is building "S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.csproj" (5) on node 3 (default targets).
     5>GenerateTargetFrameworkMonikerAttribute:
       Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
       CoreCompile:
         C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Mi
         crosoft\Framework\.NETFramework\v4.5\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.N
         ETFramework\v4.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFr
         amework\v4.5\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.dll
         " /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\ConsoleApplication1.exe /subsystemversion:6.00 /target:exe /utf8out
         put Program.cs Properties\AssemblyInfo.cs "C:\Users\werners\AppData\Local\Temp\.NETFramework,Version=v4.5.AssemblyAttributes.cs"
     3>Project "S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2.sln" (3) is building "S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.csproj" (7) on node 4 (default targets).
     7>GenerateTargetFrameworkMonikerAttribute:
       Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
       CoreCompile:
         C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Mi
         crosoft\Framework\.NETFramework\v4.5\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.N
         ETFramework\v4.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFr
         amework\v4.5\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.dll
         " /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\ConsoleApplication2.exe /subsystemversion:6.00 /target:exe /utf8out
         put Program.cs Properties\AssemblyInfo.cs "C:\Users\werners\AppData\Local\Temp\.NETFramework,Version=v4.5.AssemblyAttributes.cs"
   4:2>Project "S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3.sln" (4:2) is building "S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3\ConsoleApplication3.csproj" (6:2) on node 1 (default targets).
     6>GenerateTargetFrameworkMonikerAttribute:
       Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
       CoreCompile:
         C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsof
         t\Framework\.NETFramework\v4.5\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFram
         ework\v4.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramewor
         k\v4.5\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.dll" /ref
         erence:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.Linq.dll" /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\ConsoleApplication3.exe /subsystemversion:6.00 /target:exe /utf8output Progr
         am.cs Properties\AssemblyInfo.cs "C:\Users\werners\AppData\Local\Temp\.NETFramework,Version=v4.5.AssemblyAttributes.cs"
     4>Project "S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3.sln" (4) is building "S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3\ConsoleApplication3.csproj" (6) on node 2 (default targets).
     6>GenerateTargetFrameworkMonikerAttribute:
       Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
       CoreCompile:
         C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Mi
         crosoft\Framework\.NETFramework\v4.5\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.N
         ETFramework\v4.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFr
         amework\v4.5\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.dll
         " /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\ConsoleApplication3.exe /subsystemversion:6.00 /target:exe /utf8out
         put Program.cs Properties\AssemblyInfo.cs "C:\Users\werners\AppData\Local\Temp\.NETFramework,Version=v4.5.AssemblyAttributes.cs"
     5>_CopyAppConfigFile:
         Copying file from "App.config" to "bin\Debug\ConsoleApplication1.exe.config".
       CopyFilesToOutputDirectory:
         Copying file from "obj\Debug\ConsoleApplication1.exe" to "bin\Debug\ConsoleApplication1.exe".
         ConsoleApplication1 -> S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe
         Copying file from "obj\Debug\ConsoleApplication1.pdb" to "bin\Debug\ConsoleApplication1.pdb".
     5>Done Building Project "S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.csproj" (default targets).
     7>_CopyAppConfigFile:
         Copying file from "App.config" to "bin\Debug\ConsoleApplication2.exe.config".
       CopyFilesToOutputDirectory:
         Copying file from "obj\Debug\ConsoleApplication2.exe" to "bin\Debug\ConsoleApplication2.exe".
         ConsoleApplication2 -> S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe
         Copying file from "obj\Debug\ConsoleApplication2.pdb" to "bin\Debug\ConsoleApplication2.pdb".
     7>Done Building Project "S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.csproj" (default targets).
   3:2>Project "S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2.sln" (3:2) is building "S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.csproj" (7:2) on node 3 (default targets).
     7>GenerateTargetFrameworkMonikerAttribute:
       Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
       CoreCompile:
         C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsof
         t\Framework\.NETFramework\v4.5\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFram
         ework\v4.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramewor
         k\v4.5\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.dll" /ref
         erence:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.Linq.dll" /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\ConsoleApplication2.exe /subsystemversion:6.00 /target:exe /utf8output Progr
         am.cs Properties\AssemblyInfo.cs "C:\Users\werners\AppData\Local\Temp\.NETFramework,Version=v4.5.AssemblyAttributes.cs"
     6>_CopyAppConfigFile:
         Copying file from "App.config" to "bin\Debug\ConsoleApplication3.exe.config".
       CopyFilesToOutputDirectory:
         Copying file from "obj\Debug\ConsoleApplication3.exe" to "bin\Debug\ConsoleApplication3.exe".
         ConsoleApplication3 -> S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3\bin\Debug\ConsoleApplication3.exe
         Copying file from "obj\Debug\ConsoleApplication3.pdb" to "bin\Debug\ConsoleApplication3.pdb".
     6>Done Building Project "S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3\ConsoleApplication3.csproj" (default targets).
     6>_CopyAppConfigFile:
         Copying file from "App.config" to "bin\Release\ConsoleApplication3.exe.config".
       CopyFilesToOutputDirectory:
         Copying file from "obj\Release\ConsoleApplication3.exe" to "bin\Release\ConsoleApplication3.exe".
         ConsoleApplication3 -> S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3\bin\Release\ConsoleApplication3.exe
         Copying file from "obj\Release\ConsoleApplication3.pdb" to "bin\Release\ConsoleApplication3.pdb".
     6>Done Building Project "S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3\ConsoleApplication3.csproj" (default targets).
   2:2>Project "S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1.sln" (2:2) is building "S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.csproj" (5:2) on node 4 (default targets).
     5>GenerateTargetFrameworkMonikerAttribute:
       Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
       CoreCompile:
         C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsof
         t\Framework\.NETFramework\v4.5\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFram
         ework\v4.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramewor
         k\v4.5\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.dll" /ref
         erence:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.Linq.dll" /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\ConsoleApplication1.exe /subsystemversion:6.00 /target:exe /utf8output Progr
         am.cs Properties\AssemblyInfo.cs "C:\Users\werners\AppData\Local\Temp\.NETFramework,Version=v4.5.AssemblyAttributes.cs"
     2>Done Building Project "S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1.sln" (Build target(s)).
     3>Done Building Project "S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2.sln" (Build target(s)).
     4>Done Building Project "S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3.sln" (Build target(s)).
     4>Done Building Project "S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3.sln" (Build target(s)).
     7>_CopyAppConfigFile:
         Copying file from "App.config" to "bin\Release\ConsoleApplication2.exe.config".
       CopyFilesToOutputDirectory:
         Copying file from "obj\Release\ConsoleApplication2.exe" to "bin\Release\ConsoleApplication2.exe".
         ConsoleApplication2 -> S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2\bin\Release\ConsoleApplication2.exe
         Copying file from "obj\Release\ConsoleApplication2.pdb" to "bin\Release\ConsoleApplication2.pdb".
     7>Done Building Project "S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.csproj" (default targets).
     3>Done Building Project "S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2.sln" (Build target(s)).
     5>_CopyAppConfigFile:
         Copying file from "App.config" to "bin\Release\ConsoleApplication1.exe.config".
       CopyFilesToOutputDirectory:
         Copying file from "obj\Release\ConsoleApplication1.exe" to "bin\Release\ConsoleApplication1.exe".
         ConsoleApplication1 -> S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1\bin\Release\ConsoleApplication1.exe
         Copying file from "obj\Release\ConsoleApplication1.pdb" to "bin\Release\ConsoleApplication1.pdb".
     5>Done Building Project "S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.csproj" (default targets).
     2>Done Building Project "S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1.sln" (Build target(s)).
     1>Done Building Project "S:\msbuild\parallel\ConsoleApplication1\master.proj" (default targets).
Deferred Messages

         Detailed Build Summary
         ======================


         ============================== Build Hierarchy (IDs represent configurations) =====================================================
         Id                  : Exclusive Time   Total Time   Path (Targets)
         -----------------------------------------------------------------------------------------------------------------------------------
         0                   : 0.053s           0.457s       S:\msbuild\parallel\ConsoleApplication1\master.proj ()
         | 1                 : 0.027s           0.325s       S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1.sln (Build)
         | . 7               : 0.222s           0.222s       S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.csproj ()
         | 2                 : 0.012s           0.309s       S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2.sln (Build)
         | . 8               : 0.269s           0.269s       S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.csproj ()
         | 3                 : 0.009s           0.299s       S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3.sln (Build)
         | . 9               : 0.267s           0.267s       S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3\ConsoleApplication3.csproj ()
         | 4                 : 0.012s           0.367s       S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1.sln (Build)
         | . 10              : 0.106s           0.106s       S:\msbuild\parallel\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.csproj ()
         | 5                 : 0.011s           0.326s       S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2.sln (Build)
         | . 11              : 0.133s           0.133s       S:\msbuild\parallel\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.csproj ()
         . 6                 : 0.010s           0.271s       S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3.sln (Build)
         | . 12              : 0.249s           0.249s       S:\msbuild\parallel\ConsoleApplication3\ConsoleApplication3\ConsoleApplication3.csproj ()

         ============================== Node Utilization (IDs represent configurations) ====================================================
         Timestamp:            1       2       3       4        Duration   Cumulative
         -----------------------------------------------------------------------------------------------------------------------------------
         635293905985195918:   0       x       x       x        0.052s     0.052s #
         635293905985714767:   1       x       x       x        0.018s     0.070s
         635293905985894149:   2       x       7       x        0.010s     0.080s
         635293905985993932:   3       x       |       8        0.009s     0.089s
         635293905986083729:   4       9       |       |        0.011s     0.100s
         635293905986193468:   5       |       |       |        0.010s     0.110s
         635293905986293247:   6       |       |       |        0.009s     0.119s
         635293905986383052:   12      |       |       |        0.174s     0.292s ###
         635293905988119133:   |       |       11      |        0.057s     0.349s #
         635293905988687942:   |       |       |       10       0.007s     0.356s
         635293905988757691:   |       x       |       |        0.012s     0.368s
         635293905988877370:   1       x       |       |        0.009s     0.377s
         635293905988967228:   2       x       |       |        0.002s     0.379s
         635293905988987132:   6       x       |       |        0.046s     0.425s
         635293905989446047:   5       x       x       |        0.001s     0.426s
         635293905989456078:   x       x       x       |        0.029s     0.455s
         635293905989745347:   4       x       x       x        0.001s     0.456s
         635293905989755363:   0       x       x       x        0.001s     0.457s
         -----------------------------------------------------------------------------------------------------------------------------------
         Utilization:          83.6    72.6    91.7    99.5     Average Utilization: 86.9

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.61

There is a post that can help you discern what was built on what node.

You should also be aware that there are no dependencies between the solution. If there are, you'll have to be more creative. The MSDN documentation about using item metadata with task batching may help.

References:

  • Building Multiple Projects in Parallel with MSBuild
  • MSBuild not building with all cores
  • MSBuild 4 Detailed Build Summary
  • MSBuild Batching
  • Item Metadata in Task Batching
like image 157
bloudraak Avatar answered Oct 19 '22 09:10

bloudraak