title: MSBuild multiple outputpath
body: <p>I saw <a href="https://stackoverflow.com/questions/14107302/msbuild-copy-multiple-files-to-multiple-directories-repeatedly" title="this">this</a> S.O question and have a similar requirement. This is what I have in a .targets file -</p>
  
  <pre><code>    &lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
        &lt;PropertyGroup Condition="$(TeamBuildOutDir) != '' "&gt;
          &lt;OutputPath&gt;$(TeamBuildOutDir)\Assemblies&lt;/OutputPath&gt;                 
      &lt;/PropertyGroup&gt;
  </code></pre>
  
  <p>How can I output to multiple folders?
  e.g.- $(TeamBuildOutDir)\Assemblies2 </p>
  
  <p>TIA</p>
  
  <p>Thanks Nick, The copy/paste mucked it up. This is what I tried -</p>
  
  <pre><code>&lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  &lt;PropertyGroup Condition="$(TeamBuildOutDir) != '' "&gt;
   &lt;OutputPath&gt;$(TeamBuildOutDir)\Assemblies&lt;/OutputPath&gt;                   
  &lt;/PropertyGroup&gt;
  &lt;Target Name="AfterBuild"&gt;
   &lt;Copy SourceFiles="$(OutputPath)\**\*.*" DestinationFolder="$(TeamBuildOutDir)\Assemblies2" /&gt;
  &lt;/Target&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>I've also tried - </p>
  
  <pre><code> &lt;Copy SourceFiles="$(OutputPath)\***\*.*" DestinationFolder="$(TeamBuildOutDir)\Assemblies2" /&gt;
  </code></pre>
  
  <p>and -</p>
  
  <pre><code> &lt;Copy SourceFiles="$(OutputPath)\***\*.*" DestinationFolder="$(TeamBuildOutDir)\" /&gt;
  </code></pre>
  
  <p>in case the directory not being present caused an issue but still no luck.</p>
  
  <p>Updated 7/28. Tried this but doesn't work still (no errors but the files are not present in the output directory. They are present in the Assemblies folder so I know the targets file is being triggered.) -</p>
  
  <pre><code>&lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  &lt;PropertyGroup Condition="$(TeamBuildOutDir) != '' "&gt;
   &lt;OutputPath&gt;$(TeamBuildOutDir)\Assemblies&lt;/OutputPath&gt;                   
  &lt;/PropertyGroup&gt;
  &lt;Target Name="AfterBuild"&gt;
   &lt;CreateItem Include="$(OutputPath)\**\*.*"&gt;
       &lt;Output ItemName="Outfiles" TaskParameter="Include" /&gt;
   &lt;/CreateItem&gt;
   &lt;Copy SourceFiles="@(Outfiles)" DestinationFiles="@(Outfiles-&gt;'$(TeamBuildOutDir)\%(relativedir)%(Filename)%(Extension)')" SkipUnchangedFiles="false" /&gt;
  &lt;/Target&gt;
  &lt;/Project&gt;
  </code></pre>