title: MSBuild Batching - Can't figure out how to get a target to be run only for some Solutions
body: <p>I have something like this in my TFSBuild.proj  </p>
  
  <pre><code>&lt;ItemGroup&gt;
      &lt;SolutionToBuild Include="$(BuildProjectFolderPath)/../../ProjectA/ProjectA.sln" /&gt;
      &lt;SolutionToBuild Include="$(BuildProjectFolderPath)/../../x64 Installer/x64 Installer.sln" Condition="'$(Platform)' == 'x64' " /&gt;
      &lt;SolutionToBuild Include="$(BuildProjectFolderPath)/../../x86 Installer/x86 Installer.sln" Condition="'$(Platform)' == 'x86' " /&gt;
      &lt;ConfigurationToBuild Include="Release|x86"&gt;
          &lt;FlavorToBuild&gt;Release&lt;/FlavorToBuild&gt;
          &lt;PlatformToBuild&gt;x86&lt;/PlatformToBuild&gt;
      &lt;/ConfigurationToBuild&gt;
  
      &lt;ConfigurationToBuild Include="Release|x64"&gt;
          &lt;FlavorToBuild&gt;Release&lt;/FlavorToBuild&gt;
          &lt;PlatformToBuild&gt;x64&lt;/PlatformToBuild&gt;
      &lt;/ConfigurationToBuild&gt;
  &lt;/ItemGroup&gt;  
  </code></pre>
  
  <p>I want to override the BeforeCompile target to run a custom task I have written. The custom task will take the output from ProjectA and build file that is used by both installer projects (Wix project files). How to I get the BeforeCompile target to only execute for those two SolutionToBuild items? I assume this is about Target Batching (because I can then use conditions on my task, but I don't get it.  </p>
  
  <p>I tried adding something like this to see if it would work, but only the first solution is output to the log:  </p>
  
  <pre><code>&lt;Target Name="BeforeCompile" Outputs="%(SolutionToBuild.Identity)"&gt;
    &lt;Message Text="Solution being built: %(SolutionToBuild.Identity)" /&gt;
  &lt;/Target&gt;
  </code></pre>