title: How do you filter an ItemGroup?
body: <p>I'm trying to create a filtered item group from another one, where the filtered item group will only contain items from the first group that have a specified file extension.</p>
  
  <p>I'm getting the following error:</p>
  
  <p>error MSB4190: The reference to the built-in metadata "Extension" at position 1 is not allowed in this condition "'%(Extension)'=='.sys'".</p>
  
  <p>When I run this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
           DefaultTargets="Go"
           ToolsVersion="4.0"&gt;
  
    &lt;ItemGroup&gt;
      &lt;Files Include="X.exe"/&gt;
      &lt;Files Include="Y.sys"/&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;SysFiles Include="%(Files.Identity)" Condition="'%(Extension)'=='.sys'"&gt;
      &lt;/SysFiles&gt;
    &lt;/ItemGroup&gt;
  
    &lt;Target Name="Go"&gt;
      &lt;Message Text="SysFiles=@(SysFiles)"/&gt;
    &lt;/Target&gt;
  
  &lt;/Project&gt;
  </code></pre>
  
  <p>Firstly, I can't understand why the meta data isn't allowed at this position? Is it some artificial restriction or unimplemented part of msbuild?</p>
  
  <p>Secondly, what's a concise way of achieving this kind of transform?</p>
  
  <p>Thanks very much.</p>