I am building ASP.NET application with C# and I want to connect to oracle database.
I have added reference to Oracle.DataAccess
in my application on my 64bit Microsoft Window Server 2008 machine.
I also installed ODAC (Oracle Data Access Component) on my machine
and Oracle.DataAccess.dll
is also present on this path
C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess
but when i'm trying to connect i encounter following error:
Could not load file or assembly 'Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.
As far as I know, the Oracle.DataAccess
assembly works only with 32 bits, I also have this kind of problem with 64 bits and it really does not work. My solution was remove the 64bits from GAC and install the 32 bits on GAC. I also remove any .dll file in the bin folder to my application find the assembly on GAC.
There is no problem if your machine and operational system is 64bits, the 32bits version will work fine.
UPDATE
I recommend you take a look at Official Oracle ODP.NET, Managed Driver
, that is a better version than Oracle.DataAccess
. This Managed Driver
does not need the Oracle Client
on the machine, and you just need to provide the TNS on the DataSource field of the connection string
and it works fine for 32
and 64
bits.