title: Visual Studio 2008 project reference
body: <p>I have a problem with the "Copy to output" functionality in Visual Studio 2008. Maybe I'm misunderstanding how its supposed to work.</p>
  
  <p>I have a solution with four projects:</p>
  
  <ul>
  <li>TestApp1 (Windows application)</li>
  <li>TestAppA (Windows application)</li>
  <li>TestProj1 (Class library)</li>
  <li>TestProjA (Class library)</li>
  </ul>
  
  <p>The dependencies are as follows (dependency as in project reference).</p>
  
  <ul>
  <li>TestProj1 depends on nothing.</li>
  <li>TestApp1 depends on TestProj1</li>
  <li>TestProjA depends on TestProj1</li>
  <li>TestAppA depends on TestProjA (and hence indirectly on TestProj1)</li>
  </ul>
  
  <p>In other words, the dependency tree looks like this.</p>
  
  <pre><code>TestApp1
      TestProj1
  TestProjA
      TestProj1
  TestAppA
      TestProjA
          TestProj1
  </code></pre>
  
  <p>(each project has a reference to the standard assemblies (system, system.core, etc) as well)</p>
  
  <p>In TestProj1, I have added a text file, Test.txt. In the properties for this file, I have specified "Build Action: Content" and "Copy to Output Directory: Copy always".</p>
  
  <p>When I build the solution, Test.txt is copied to</p>
  
  <ul>
  <li>TestApp1\bin\Debug</li>
  <li>TestProj1\bin\Debug</li>
  <li>TestProjA\bin\Debug</li>
  </ul>
  
  <p>The file is <em>not</em> copied to TestAppA\bin\debug and this is what I find weird. Since TestProj1 relies on Test.txt to work, and TestAppA relies on TestProj1, via TestProjA, TestApp1 won't work. </p>
  
  <p>If I add a project reference from TestAppA directly to TestProj1 (so I have one reference to TestProj1 and another to TestProjA), the file will be copied to the TestAppA\bin\debug folder.</p>
  
  <p>Of course, I could set up a custom build event to copy the file Test.txt to TestAppA\bin\debug, but I have bad experiences with custom build events and would prefer to rely on the built-in copy mechanisms.</p>
  
  <p>So my question is: Why isn't Test.txt copied to TestAppA\Bin\debug?</p>