"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."
There could be a possibility that Oracle Client 64 bit(drivers) is not installed properly on Windows 2008 r2. This improper installation of Oracle Client doesn't affect connectivity with Oracle for .NET Windows or Console application. It affects only Web based applications.
To check whether Oracle Client is installed properly or not, follow the following steps.
- Create one UDL file: Create one text file and name it as "conn.udl".
- Open conn.udl file. By opening that file, you will see a window as shown below:
- Select "Microsoft OLE DB Provider for Oracle" and click on Next button which will take you to the next tab "Connection".
- In this Connection tab, Give Database server name, User name and password and click on Test Connection. If all the Credentials are correct and required TNS entry is there in tnsnames.ora file, then it will give a connection successful message as shown below. If this message is coming, then Oracle Client installation is done properly.
Connectivity of ASP.NET With Oracle Client can be because of improper installation of Oracle Client on the server. So this is the basic Check we can do to verify it.