title: Visual Studio (2008) mixed mode project dependencies. C-sharp project depends on C++ dll, but C++ dll is not getting re-built
body: <p>I have a Visual Studio 2008 solution with two projects in it. A C++ DLL and a Csharp application.</p>
  
  <p>The Csharp application uses [DllImport] to access the functions in the DLL, and has a dependency set on the DLL.</p>
  
  <p>For some reason, setting the dependency isn't sufficient to cause VS to copy the DLL to the build path of the app. So the app project has a post-build event which causes the DLL to get copied. (If anyone knows of a cleaner way of doing this, please let me know!)</p>
  
  <p>The problem I have is that when I make a change to the DLL code, then attempt to run the Csharp application in the debugger, VS2008 fails to realise that the DLL must be rebuilt (and re-copied).</p>
  
  <p>I have to force a re-build of the Csharp application (ie by explicitly choosing build, or by "touching" a .CS file).</p>
  
  <p>Does anyone know how to tell Visual Studio to do the right thing?</p>
  
  <p>Edits: 
  I <em>am</em> using project dependencies. They aren't working correctly.</p>
  
  <p>I <em>am</em> using a post-build event to copy the DLL across.</p>
  
  <p>The issue is that, if you simply choose to debug the application, Visual Studio <em>fails</em> to recompile the changed C++ project, <em>despite the fact that there is a dependency in place</em>.</p>
  
  <p>I know the dependency is working, because if I choose "Build" (as opposed to "Debug") the C++ DLL is built.</p>