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.
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.
We found this link Targeting both 32bit and 64bit with Visual Studio in same solution/project 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).
Any tips or techniques on how to solve this are more than welcome.