views:

43

answers:

2

Hi there!

I've built and installed my service from vs2010 onto a 64bit machine.

My problem comes in when my service references 32 bit dlls (spssio32.dll to be precise) - I get the error in my event viewer : "System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"

Any help on the matter would be appreciated.

Regards, Byron Cobb.

+1  A: 

Is your service code written in a .NET language? If so, you need to mark it as targeting x86 rather than Any CPU (via Project properties / Build / Platform target).

(By default, .NET code targets Any CPU, meaning that on 64-bit machines it will compile into x64 machine code. Because such 64-bit code can't load 32-bit DLLs, that can lead to failures like the one you're seeing. Where code has a dependency on a 32-bit DLL, it needs to always compile to 32-bit machine code even on 64-bit machines, hence setting the target platform to x86.)

RichieHindle
I'm using Visual Studio 2010 with my build mode in release set to x86.
Byron Cobb
Ah - My Solution was set to compile as any CPU and even though I had the build in x86 it was using the solution properties. It works now - Thanks, you're a life saver!
Byron Cobb
+1  A: 

You can use a COM surrogate

http://www.dnjonline.com/article.aspx?id=jun07_access3264

The other variant is to spawn an external 32 Bit server-process and add a .NET remoting interface to it and your 64 bit application, so you can use .NET remoting for interprocess communication.

Quandary