Sunil Jadhav
Sunil Jadhav

Reputation: 127

System.BadImageFormatException' occurred in your application(E.g. MyApplication.exe)

I am using Windows Application to communicate with Oracle 11g database to fetch some data. Oracle database was installed on the X64 bit system. My Application builds successfully on my system (the x86 bit) with x64 bit dlls of Oracle. But when I run application below mentioned errors occurred.

An unhandled exception of type 'System.BadImageFormatException' occurred in your application(E.g. MyApplication.exe) Additional information: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. An attempt was made to load a program with an incorrect format.

I had tried different ways to resolve this issue but still unable to found a solution for same. Please help me to resolve this issue.

Upvotes: 1

Views: 621

Answers (1)

Markus Dresch
Markus Dresch

Reputation: 5584

You are trying to load a 64bit DLL from a 32 bit process or vice versa. Make sure the DLLs you want to load have the same bitness as your process.

Upvotes: 1

Related Questions