-1

I have a reference to a 32 bit dll file in my Windows Service application.

I'm using Any CPU during the debug and at this point the regular 32 bit version of the dll file works fine. But, when I built it in 64 bits and installed on a 64 Windows Service I get bad image when using method from the dll file.

I have a 64 bit version of the dll file but it does not work in my debug mode.

How do I make it use the 64 at release and the 32 in debug without manually remove and add the reference?

Ricardo Rocha
  • 14,612
  • 20
  • 74
  • 130
Banshee
  • 15,376
  • 38
  • 128
  • 219

2 Answers2

3

You can't. You have to compile it for one or the other. If you reference your 32-bit DLL, you must set the application to target x86 both for debugging and for release. If you want it to run in full 64-bit mode, you need to reference your 64-bit DLL and set the application to target x64 in debug mode and in release mode as well.

rory.ap
  • 34,009
  • 10
  • 83
  • 174
1

You need to compile two versions of the binary for each arch.

Turrican
  • 607
  • 4
  • 9