Convert group item to separator string

My question is almost identical to Create a group of row elements in MSBuild , however the solution proposed there still wraps the existing delimiter. Here is a simplified snippet of what I'm trying to do:

<Target Name="Testing"> <ItemGroup> <Files Include="$(RootDirectory)\*.*"/> </ItemGroup> <Message Text="@(Files->'%(Filename)%(Extension) ')"/> </Target> 

My desired result is something like this:

 file1.cs file2.cs file3.cs 

However, the above snippet outputs the following output

 file1.cs ;file2.cs ;file3.cs 

What did I do wrong?

+8
msbuild transform
source share
1 answer

Try using MSBuild transforms as follows:

  <Message Text="@(Files->'%(Filename)%(Extension)', ' ')"/> 
+23
source share

All Articles