How to make ODP.NET 4.0 (64 bit) work on a 64-bit Windows 7 machine?

I installed Oracle Client for a 64-bit machine using XCopy 11.2 provided by Oracle (everything is installed according to the reading instructions).

I am using Visual Studio 2010, and the project is of type ASP.NET Website.

When I tried to execute my ASP.NET website using the above Oracle connection, it gives me an error from the web.config file at compile time.

**

"Failed to load file or assembly 'Oracle.DataAccess, Version = 4.112.2.0, Culture = neutral, PublicKeyToken = 89b483f429c47342' or one of its dependencies. The system cannot find the file."

**

It worked if I changed the Enable 32-Bit Applications value to True in the IIS application pool.

But my requirement is to make it work on a 64-bit machine with a 64-bit ODP.NET connector, so I do not want to change the Enable 32-Bit Applications value to True.

So, if you could help me find an answer that would be greatly appreciated. Please help me fix the above error.

+2
source share
2 answers

The best way to handle this is to use the x86 version locally with the Visual Studio and x64 versions on the server with IIS. To do this, you need to download both versions - copy one to the lib \ x86 folder and the other to lib \ x64. After that, you have to change the project file - visual studio supports conditional links. Add the following file to the project file:

<PropertyGroup>
     <ReferencesPath Condition=" '$(Platform)' == 'x86' ">..\Lib\x86</ReferencesPath>
     <ReferencesPath Condition=" '$(Platform)' == 'x64' ">..\Lib\x64</ReferencesPath>
</PropertyGroup>

odp.net assmebly :

<Reference ... processorArchitecture=$(Platform)">
   <SpecificVersion>False</SpecificVersion>
   <HintPath>$(ReferencesPath)\Oracle.DataAccess.dll</HintPath>
   <Private>True</Private>
</Reference>

, x86 x64, Oracle.DataAccess.dll.

, x64 , IIS, , Cassini x64 (http://cassinidev.codeplex.com).

, , - - .

+4

64- Oracle (ODAC), Oracle Client Oracle.DataAccess.dll .

, " 32- " .

, , 32- dll bin -. , - 64 , .

+1

All Articles