views:

81

answers:

1

Hi, I'm trying to access an Oracle Database from a program I'm writing on Windows 7 64bit. Whenever it initializes the client, i get a BadImageFormatException complaining that I'm trying to use a 32bit client in a 64bit environment. I've tried to compile the program in any way (Any CPU, 32, 64 bit), but it did not solve the problem. Any help?

A: 

I would guess that the error message is correct. You have a 32 bit Oracle DLL that you use from a 64 process. The Oracle DLL probably does some interop's with native code, that may require it to be processor specific.

There are several ways to solve this.

Option 1: Get the 64 bit Oracle DLLs.

Option 2: Make sure that your process is 32 bit. .NET exe files marked for AnyCPU will start a 64 bit process on a 64 bit operating system. But if you mark your EXE file for x86 then it should work. For Web applications you have to set a 32 bit flag somewhere in IIS.

Arve