title: Subversion, external references, binaries, and MSBuild/Visual Studio
body: <p>I have a project that is stored in a Subversion repository.</p>
  
  <p>In this repository, in a different folder, I have a set of libraries that I use in many of my projects. These libraries are stored as binary files, ie. the dll's, pdb's, and xml's.</p>
  
  <p>Here's an example layout:</p>
  
  <pre><code>&lt;repo-url&gt;
      \Libraries
          \SQLite
          \SystemHooks
          \Moq
  </code></pre>
  
  <p>In the application project, I add a "libs" directory, then add a svn:externals reference property to that directory to pull in the libraries I need.</p>
  
  <p>For instance, for this project I am working on now, which prompted this question, I need the SystemHooks library, so in my app project folder structure, it now looks like this:</p>
  
  <pre><code>SketchingMode         &lt;-- solution folder, other projects here as well
      SketchingMode     &lt;-- app project folder
          libs
              SystemHooks
  </code></pre>
  
  <p>The nice thing about this is that I can more easily update the libraries, and just use the -rXYZ specifier for the externals definition to avoid pulling in newer versions than I'm ready to accept, and still have only one copy of each file/version in my repository.</p>
  
  <p>The bad thing, in this particular case, is that one of the dll's in the SystemHooks directory (2 if I want the pdb as well) needs to be copied to the output directory, not referenced by the project.</p>
  
  <p>References work as normal, but once I tag one of the files in this directory as "Content" and "Copy always" or "Copy if newer", then the libs and SystemHooks directory structure is also copied to the output directory.</p>
  
  <p>As such, after a build, my on-disk directory structure looks like this:</p>
  
  <pre><code>SketchingMode         &lt;-- solution folder, other projects here as well
      SketchingMode     &lt;-- app project folder
          libs
              SystemHooks
          bin
              Debug               &lt;-- main build output here
                  libs
                      SystemHooks &lt;-- 1-2 files in here
  </code></pre>
  
  <p>Is the only way to avoid this to use the post-build steps and just add the necessary copy statements? Or can I somehow tweak the project file to avoid copying the full structure like that?</p>
  
  <p>Just to make it clear, in the bin\Debug directory, I don't want another layer of libs\SystemHooks in there, and all the files presently being copied to the bin\Debug\libs\SystemHooks folder needs to be copied to the bin\Debug folder instead.</p>