title: MSBuild CreateItem condition include based on config file
body: <p>I'm trying to select a list of test dlls that contain corresponding config files</p>
  
  <p>MyTest.Tests.dll<br>
  MyTest.Tests.config</p>
  
  <p>I have to use a createItem as the dlls are not available at the time of the script loading</p>
  
  <pre><code>&lt;CreateItem Include="$(AssemblyFolder)\*.Tests.dll"
              Condition="???"
    &lt;Output TaskParameter="Include" ItemName="TestBinariesWithConfig"/&gt;
  &lt;/CreateItem&gt;
  </code></pre>
  
  <p>Is there a condition I can use or is this the wrong approach?</p>
  
  <p>Thanks<br>
  Mac</p>
  
  <p>EDIT:</p>
  
  <p>ok, to clarify, I need to construct a xUnit.Net project file. I need to do this because I'm running the tests through the xUnit.Console runner via nCover (don't ask!) but the long and short of it is I can only use a project file. The problem I'm having is when I have a test dll with an associated .config file. Without the config file, the test runner will fail.</p>
  
  <p>This means I need to conditionally add an extra attribute (config-file) in the test project file.</p>
  
  <p>The project template file:  </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xunit&gt;
    &lt;assemblies&gt;
  &lt;!-- SAMPLE    &lt;assembly filename="Tests.dll" shadow-copy="false" config-file="Tests.dll.config" /&gt;     --&gt;
  &lt;!-- @TARGETS@ --&gt;
    &lt;/assemblies&gt;
  &lt;/xunit&gt;
  </code></pre>
  
  <p>The FileUpdate task for the test dlls with no config file.</p>
  
  <pre><code>&lt;FileUpdate
    Files="$(AssemblyFolder)\$(XUnitProjectFileName)"
    Regex="&amp;lt;!-- @TARGETS@ --&amp;gt;"
    ReplacementText="&amp;lt;!-- @TARGETS@ --&amp;gt;%0D%0A&amp;lt;assembly filename='$(AssemblyFolder)\%(TestBinaries.FileName)%(TestBinaries.Extension)' shadow-copy='false' /&amp;gt;"
    /&gt;
  </code></pre>
  
  <p>So I need a way to conditionally add the extra attribute in the FileUpdate task depending on whether there is a corresponding config file for the test dll.</p>