Archive for the ‘IIS’ Category

Attempt to load Oracle client libraries threw BadImageFormatException.

Error Message : Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.
Situation :
case 1) If you are using 64 bit machine for development and want to publish project on your machine then
case 1) If you are using 64 bit machine for server and want to publish project on server then
and if 32 bit version of oracle is not installed in your machine.

Resolution :

1) If 32 bit client version of oracle is not installed, then install 32 bit client. then problem will be resolved.

2) If you want to run published setup on 32 bit, then go to iis (inetmgr), then select application pool which you have assigned to your application => go to advanced setting => Enable 32-bit Application = true.
Means now your application will run on 32 bit environment instead of 64 bit environment.
IIS 32 bit enabled and 32 bit Oracle client works.
IIS 32 bit disabled and 64 bit Oracle client works too.