Question

My question is almost identical to Create an ItemGroup of strings in MSBuild however the solution offered there still seems to carry over the existing delimiter. Here's a simplified snippet of what I'm attempting to do:

<Target Name="Testing">
  <ItemGroup>
    <Files Include="$(RootDirectory)\*.*"/>
  </ItemGroup>

  <Message Text="@(Files->'%(Filename)%(Extension) ')"/>
</Target>

My desired output is something that looks like this:

file1.cs file2.cs file3.cs

However the snippet above produces the following output

file1.cs ;file2.cs ;file3.cs

What have I done wrong?

Was it helpful?

Solution

Try to use MSBuild transforms like this:

    <Message Text="@(Files->'%(Filename)%(Extension)', ' ')"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top