.net – 32bit 64bit referenced library


I am developing an application that has two DLLs one is a 32bit version another is 64bit version,

Client is 32bit
Server is 64bit

My question is is there a way I can say use the 32bit dll when doing Debug/Release and use 64bit dll when I perform a publish.

I realize I can solve this problem using NAnt or MSBuild but was wondering if I can do any of this in visual studio.


All my code will run on either 32bit or 64bit but I am using a library that has a 32bit library and a 64bit library. 32bit wont work on server, 64bit wont work on dev machine

Best Solution

You can try to do the following:

  1. On the Release\Debug set the Platform Target to x86.
  2. Create a new project Configuration called Publish set the Platform Target to x64.
  3. Copy the x86 library to bin\release bin\debug and the x64 to bin\publish.
Related Question