I am getting this error while on of my .Net
application are trying to make a connection to oracle database.
The error says that This problem will
I would like to add a resolution that worked for me. Setup: Oracle 11g 64 bits running on Windows 2008 R2 (64 bits OS)
Client is a .net framework 3.5 application (ported from 2.0) compiled with x86 platform setting.
I had the exact same issue of BadImageFormatException. Compiling to 64 bits eliminates the exception but it was not an option for me as my app is using 32 bits activex components who do not work in 64 bits.
I solved the issue by downloading Oracle Instant Client 11 (this is just a bunch of DLL than can be xcopied) from Oracle website, and copying the files in my application files directory. See here : http://www.oracle.com/technetwork/database/features/oci/instant-client-wp-131479.pdf
This has solved the issue, from ProcMon tool I can see that the locally copied oci.dll gets loaded by System.Data.OracleClient and everything is fine.
It could probably be done by changing environment settings like proposed above, but this method has the advantage of not altering any settings on the server configuration.