I\'m trying to use the Oracle ODP.NET 11g (11.1.0.6.20) Instant Client on my ASP.net project as a Data Provider but when I run the aspx pag
TLDR Version:
Full version:
First, lets make sure we understand the components of the old unmnaged provider (not the new 12c 100% managed provider). It's made up of two pieces:
Simply speaking, Oracle.DataAccess.dll is nearly just a wrapper, translating .net instructions into ORACLE-NET instructions for the unmanaged client.
That said, when you load Oracle.DataAccess there is a order in which it tries to locate the unmanaged client dlls that it needs. From the Oracle Documentation:
The Oracle.DataAccess.dll searches for dependent unmanaged DLLs (such as Oracle Client) based on the following order:
1.Directory of the application or executable.
2.DllPath setting specified by application config or web.config.
3.DllPath setting specified by machine.config.
4.DllPath setting specified by the Windows Registry.
HKEY_LOCAL_MACHINE\Software\Oracle\ODP.NET\version\DllPath
5.Directories specified by the Windows PATH environment variable.
So in your case, your app followed this process above and found a path that has unmananged dlls that are too old relative to the Oracle.DataAccess.dll assembly that you are using.
It could just be that the only Oracle Client install on that machine is too old. But this comes into play if you have more than one client installed on the machine and the unmananaged files were found first in a different but older installation. If the later, the simple thing to do is use the dllPath configuration variable in your config and point it at the correct Oracle Home Bin folder:
If you want to install a fresh copy of the client, the xcopy version is the smallest and contains the "instant client" and point the DllPath above to this new location. But any oracle client install will work.
But if you want to avoid all this unmanaged client resolution stuff, see if you can update your app to use the 100% managed provider instead - it truely is just one or two managed assemblies,without any dependency on unmananged files.
Its also possible that you aren't loading the Oracle.DataAccess.dll that you think you are if it is installed in both your bin directory and your GAC, but I think that is the less likely senario. See the assembly resolution process for more information.