title: How do I add a reference to an unmanaged C++ project called by a C# project?
body: <p>One solution (the.sln)</p>
  
  <p>One C++ project (mycppproject.vcxproj in 2010or mycppproject.vcproj in 2008) which compiles a native DLL exporting some function(s). In debug this builds c:\output\Debug\mycppproject_d.dll and in release this builds c:\output\Release\mycppproject.dll.</p>
  
  <p>One C# console application (mycsharpconsole.csproj) containing PInvoke calls into the DLL.</p>
  
  <p>All compiles fine.</p>
  
  <p>When I build, I would like to be able to add a reference from the csharp project to the cpp DLL project so that it can copy the appropriate file from the appropriate directory into the \bin\Debug directory the csharp project is built into.</p>
  
  <p>This should be possible, since the IDE knows everything there is to know about where the DLL gets built, and where the C# application gets built.</p>
  
  <p>In Visual Studio 2010:</p>
  
  <p>I've tried "Dependencies..." on the csharp project and adding a dependency on mycppproject, but that has no effect.</p>
  
  <p>I've tried "Add Reference..." on the csharp project and adding a reference to the cpp project, but I get a warning message 'The Target Framework version for the project "mycppproject" is higher than the current project Target Framework version. Would you like to add this reference to your project anyway?' (Yes/No/Cancel).</p>
  
  <p>Clicking "Yes" produces the error message "A reference to mycppproject" could not be added."</p>