I am trying to create a group of filtered elements from another, where a group of filtered elements will contain only elements from the first group with the specified file extension.
I get the following error:
error MSB4190: a reference to the built-in metadata "Extension" at position 1 is not allowed in this condition "% (extension)" == ". sys".
When I ran this:
<?xml version="1.0" encoding="utf-8"?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Go" ToolsVersion="4.0"> <ItemGroup> <Files Include="X.exe"/> <Files Include="Y.sys"/> </ItemGroup> <ItemGroup> <SysFiles Include="%(Files.Identity)" Condition="'%(Extension)'=='.sys'"> </SysFiles> </ItemGroup> <Target Name="Go"> <Message Text=" SysFiles=@ (SysFiles)"/> </Target> </Project>
Firstly, I canโt understand why metadata is not allowed in this position? Is this an artificial limitation or an unrealized part of msbuild?
Secondly, what is a concise way to achieve such a transformation?
Thank you very much.
source share