Concat in MsBuild

time to read 9 min | 1743 words

After building my own concat task for MsBuild, Jordan E. Terrell informed me that it is build in. In my defense, I couldn't find it on google :-)

At any rate, Jordan was kind enough to send me a test script that showed how it worked and directed me at the documnetation. Here is the script:

<?xml version="1.0" encoding="utf-8"?>

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Concat">

       <ItemGroup>

              <String Include="Item 1" />

              <String Include="Item 2" />

              <String Include="Item 3" />

              <String Include="Item 4" />

              <String Include="Item 5" />

       </ItemGroup>

       <Target Name="Concat">

              <Message Text="Use semi-colon (default): @(String)" />

              <Message Text="Use colon: @(String, ':')" />

              <Message Text="Use dash: @(String, '-')" />

              <Message Text="Use space: @(String, ' ')" />

       </Target>

</Project>

Thanks, Jordan. I got to delete code because of you, and that is always good :-)