Search code examples
asp.netodp.net

How to Make ODP.NET 4.0 (64 bit) working on 64 bit machine Windows 7?


I am trying to run my ASP.NET 4.0 WebSite using the ODP.NET 4.0 Client in Windows 7 64 bit machine..but no luck so far.

I have downloaded the ODP.NET 4.0 from

http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html

and installed using the instructions provided.

I am able to see both the Oracle.DataAccess.dll and Oracle.Web.dll in

C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess\v4.0_4.112.2.0__89b483f429c47342 and C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.Web\v4.0_4.112.2.0__89b483f429c47342

respectively.

The problem is when I try to Add the reference to the website, I am not able to see them in GAC ( I mean to say in the .NET tab..where all the dlls in GAC are shown)

I somehow referenced them from my local system..

But after adding the reference the following entries are created in the web.config file.

And the problem is.. When I try to build the project it fails giving me an error stating that

Could not 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 specified.

The reason I am thinking it is not finding the file is because it is looking in the GAC folder(C:Windows\Assembly) and as they are not present ..it is throwing the compile time error.

But technically the files must be located in the GAC64 folder(C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess\v4.0_4.112.2.0__89b483f429c47342) and the dll is present there.

I don't know how to resolve this error.

Note: I have to run this in 64 bit machine and that too by setting the Enable 32 bit Applications flag to false in the IIS.


Solution

  • I would search your system for this library - generally it will exist somewhere else on your system before being added to the gac. Add the reference from that location - try: ORACLE_BASE\ORACLE_HOME\ASP.NET\Bin\2.x\ or c:\Oracle\odp.net\bin\2.x\Oracle.Web.dll

    Whatever you see on that GAC reference tab is not in the gac jsut because it is on that tab. Those files are just 'reference assemblies' and can be anywhere on your system. Find the dll that is not in the GAC and add a reference to it from there. Search your system for oracle.web.dll

    Note that in: Oracle Providers for ASP.Net Installation The location is listed as: c:\Oracle\odp.net\bin\2.x\Oracle.Web.dll