title: MSBuild doesn't copy references (DLL files) if using project dependencies in solution
body: <p>I have four projects in my Visual Studio solution (everyone targeting .NET 3.5) - for my problem only these two are important:</p>
  
  <ol>
  <li><strong>MyBaseProject</strong> &lt;- this class library references a third-party DLL file (elmah.dll)</li>
  <li><strong>MyWebProject1</strong> &lt;- this web application project has a reference to MyBaseProject</li>
  </ol>
  
  <p>I added the elmah.dll reference to <strong>MyBaseProject</strong> in Visual studio 2008 by clicking "Add reference..." → "Browse" tab → selecting the "elmah.dll".</p>
  
  <p>The Properties of the Elmah Reference are as follows:</p>
  
  <ul>
  <li>Aliases - global</li>
  <li><strong>Copy local - true</strong></li>
  <li>Culture -</li>
  <li>Description - Error Logging Modules and Handlers (ELMAH) for ASP.NET</li>
  <li>File Type - Assembly</li>
  <li>Path - D:\webs\otherfolder\_myPath\__tools\elmah\Elmah.dll</li>
  <li>Resolved - True</li>
  <li>Runtime version - v2.0.50727</li>
  <li>Specified version - false</li>
  <li>Strong Name - false</li>
  <li>Version - 1.0.11211.0</li>
  </ul>
  
  <p>In <strong>MyWebProject1</strong> I added the reference to Project MyBaseProject by:
  "Add reference..." → "Projects" tab → selecting the "MyBaseProject". The Properties of this reference are the same except the following members:</p>
  
  <ul>
  <li>Description -</li>
  <li>Path - D:\webs\CMS\MyBaseProject\bin\Debug\MyBaseProject.dll</li>
  <li>Version - 1.0.0.0</li>
  </ul>
  
  <p>If I run the build in <strong>Visual Studio</strong> the elmah.dll file is copied to my <strong>MyWebProject1's bin</strong> directory, along with MyBaseProject.dll!</p>
  
  <p>However if I clean and run <strong>MSBuild</strong> for the solution (via D:\webs\CMS> C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe /t:ReBuild /p:Configuration=Debug MyProject.sln)
  the <strong>elmah.dll is missing</strong> in MyWebProject1's bin directory - although the build itself contains no warning or errors!</p>
  
  <p>I already made sure that the .csproj of MyBaseProject contains the <strong>private</strong> element with the value "true" (that should be an alias for "<strong>copy local</strong>" in Visual Studio):</p>
  
  <pre><code>&lt;Reference Include="Elmah, Version=1.0.11211.0, Culture=neutral, processorArchitecture=MSIL"&gt;
    &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
    &lt;HintPath&gt;..\mypath\__tools\elmah\Elmah.dll&lt;/HintPath&gt;
      **&lt;Private&gt;true&lt;/Private&gt;**
  &lt;/Reference&gt;
  </code></pre>
  
  <p>(The private tag didn't appear in the .csproj's xml by default, although Visual Studio said "copy local" true. I switched "copy local" to false - saved - and set it back to true again - save!)</p>
  
  <p><strong>What is wrong with MSBuild? How do I get the (elmah.dll) reference copied to MyWebProject1's bin?</strong></p>
  
  <p>I do NOT want to add a postbuild copy action to every project's postbuild command! (Imagine I would have many projects depend on MyBaseProject!)</p>