title: Creating a managed wrapper for 32bit and 64bit unmanaged DLL
body: <p>We are creating a C# wrapper around a unmanaged DLL. The unmanaged DLL comes in both a 32 and 64bit versions. We keep the managed wrapper in its own project so that we can build it as a separate component and reuse it across solutions. </p>
  
  <p>However this leads to some problems.  Since the unmanaged DLL has the same name for both the 32bit and 64bit versions we are having trouble moving the correct unmanaged DLL to the output (bin) directory. If the build configuration is x86 we want to copy the 32bit version and with x64 the 64bit.  With just one processor architecture this is easy to achieve. We just include the unmanaged DLL in our project and set copy local to true on the file. But since we need to target both its more tricky.</p>
  
  <p>We found this link <a href="https://stackoverflow.com/questions/145803/targeting-both-32bit-and-64bit-with-visual-studio-in-same-solution-project">Targeting both 32bit and 64bit with Visual Studio in same solution/project</a> but this seems to reference some DLL that already exist on the  machine. We want the correct version of the DLL to be copied to the output directory (bin).</p>
  
  <p>Any tips or techniques on how to solve this are more than welcome.</p>