title: How do you get TeamCity to flatten a directory when it creates artifacts
body: <p>We are using TeamCity 5.0 to build a C# solution using the sln2008 build runner. We have multiple projects that produce exe files. We want to use TeamCity's artifacts feature to flatten all the directories. We want all the files to go into one folder with no sub folders no matter which folder it came from. TeamCity keeps the directory hierarchy when it created the artifacts.</p>
  
  <p>Our artifacts are created using</p>
  
  <pre><code>**\bin\Release\*.*=&gt;PublishedFiles
  </code></pre>
  
  <p>What we get is</p>
  
  <ul>
  <li>PublishedFiles\FooProject\bin\Release\Foo.exe</li>
  <li>PublishedFiles\BarProject\bin\Release\Bar.exe</li>
  </ul>
  
  <p>What we want is</p>
  
  <ul>
  <li>PublishedFiles\Foo.exe</li>
  <li>PublishedFiles\Bar.exe</li>
  </ul>
  
  <p><strong><em>EDIT</em></strong></p>
  
  <p>TeamCity 5.1 will get us closer.</p>
  
  <p>The pattern</p>
  
  <pre><code>SomeLibrary\bin\Release\*.dll =&gt; PublishedFiles
  </code></pre>
  
  <p>will get us</p>
  
  <ul>
  <li>PublishedFiles\SomeLibrary.dll</li>
  <li>PublishedFiles\SomeDependency.dll</li>
  </ul>
  
  <p>but </p>
  
  <pre><code>**\bin\Release\*.dll =&gt; PublishedFiles
  </code></pre>
  
  <p>Will still keep the structure that we don't want.</p>
  
  <p>Currently we use MSBuild to flatten the structure and then TeamCity to archive it. It would be nice to skip the MSBuild part.</p>