Oracle.DataAccess.dll not loading using C #

I am having a problem loading the oracle.dataaccess file. Here is the message I get:

Failed to load file or assembly "Oracle.DataAccess, Version = 2.112.1.0, Culture = neutral, PublicKeyToken = 89b483f429c47342" or one of its dependencies. An attempt was made to download a program with the wrong format.

I have the following entries in my web.config for this.

<add assembly="Oracle.DataAccess, Version=2.112.1.0, Culture=neutral,
  PublicKeyToken=89b483f429c47342"/>

Under assemblies

and

<dependentAssembly>
  <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342"
    Culture="neutral" />
  <BindingRedirect oldVersion = "2.112.1.2" newVersion = "2.112.1.0" />
</dependentAssembly>**

I am developing on Visual Studio 2008 on a Windows Vista machine. I have an IIS 7.0 application pool for 32-bit applications, and my platform for this project is x86 instead of "Any processor."

I'm still trying to figure out what exactly is wrong in this case.

+5
source share
6

, , 64- , Visual Studio, 32- . , , , 32-, 64- . C:\Oracle\11gClient32, C:\Oracle\11gClient64. 32- , 64- .

, sqlnet.ora tnsnames.ora( ldap.ora) [oracle]\network\admin.

+3

Oracle.DataAccess 32- 64- . , , 32- 32- (x86) .

+1

, Oracle Client . Oracle.DataAccess . ODAC

+1

, ? ... ? , ... 32/64, ?

0

, :

Unhandled exception: System.BadImageFormatException: Could not load file or 
assembly 'Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, 
PublicKeyToken=89b483f429c47342' or one of its dependencies. An attempt was 
made to load a program with an incorrect format.

, 32- 64- dll. ​​ 64- , - .

, :

1)The project reference pointed to OracleDataAccess.dll , version 64 bit.
2)In the project properties -> Build -> Platform target : x64. So when you 
select x64, Prefer 32-bit option would be unchecked automatically. Then I 
did re-build of the project and deployed. 

, . ​​

0

64- x86 (Project Properties - Compile Tab - Advanced Compile Options - Target CPU) .
.

-2

All Articles