title: Are there any better ways to copy a native dll to the bin folder?
body: <p>I have C# wrapper code that calls functions from a native (C++) dll. Currently, I can add a reference to the C# dll and have set the 'Copy Local' option to true. However the native dll, which is a dependency, cannot be added as a reference - so there is no 'Copy Local' option.</p>
  
  <p>I have tried the following approaches </p>
  
  <ol>
  <li><p>Using a post-build events to copy the native dll from the Libs folder to the <code>$(TargetFolder)</code></p>
  
  <p><code>copy "$(ProjectDir)Libs\NQuantLibc.dll" "$(TargetDir)NQuantLibc.dll"</code></p></li>
  <li><p>Included the native dll as an existing item in the project (Add -> Existing Item -> Include dll). This option allows me to use the 'Copy Local' option. The downside to this approach is that the dll always shows as a project item.</p></li>
  </ol>
  
  <p>I also tried "Show All Files" which allowed me to see the Libs folder. I then include the NQuantLibc.dll file in the project which allowed me to set the 'Copy Local' option. However, this gave me a unexpected result. It created a Libs subfolder containing the dll within the bin folder (eg <code>bin/debug/Libs/NQuantLibc.dll</code>). Not ideal since the C# dll was not able to properly call the native dll since it was not there.</p>
  
  <p>Both of the above options above work. Are there any better ways to copy a native dll to the bin folder such that the dependency will always be resolved? Alternatively, is there a different approach to this type of scenario?</p>