Reputation: 780
I had been using 1 oracle client and everything was fine, but I had to install 2 more different versions of Oracle. And it's causing problems now.
I solved 1 by rearranging path values in system environment variables, putting the original Oracle path before than others. But still struggling with 2, I looked into dll loading by Process Explorer. And it looks like loading wrong oracle dlls like one from 11.2 and another from 12.1.
Of course I can try to fix this by uninstall all these oracles, and reinstall only one. But I have to keep these 3 for different development settings.
How can I fix these oracle path problems? Does anyone have clue?
Upvotes: 1
Views: 2288
Reputation: 7415
In the case of the older "unmanaged" provider, ODP.net is made up of a managed part (oracle.dataaccess.dll) and an unmanaged part (nearly all the other dlls in the oracle home directory). When oracle.dataaccess.dll is loaded up it goes thru the following search order to find the unmananged dlls that it needs:
The Oracle.DataAccess.dll searches for dependent unmanaged DLLs (such as Oracle Client) based on the following order:
Directory of the application or executable. DllPath setting specified by application config or web.config. DllPath setting specified by machine.config. DllPath setting specified by the Windows Registry. HKEY_LOCAL_ MACHINE\Software\Oracle\ODP.NET\version\DllPath Directories specified by the Windows PATH environment variable.
My first guess is that you have an old version of oracle.dataaccess.dll in your bin directory. Your simplest fix is to specify a "DllPath" configuration variable and point to the old oracle home for that asp.net site:
<configuration>
<oracle.dataaccess.client>
<add key="DllPath" value="C:\app\user\product\11.1.0\your_old_client\bin"/>
...
Another thing you could try is deleting it - that way, it may load a "better" dll from the gac (even if the version you installed was newer, the installer typically installs publisher policies to redirect any references, at least for the same major version). I say that only to give some insight on how to avoid the situation in the future. I have another answer on the subject here: https://stackoverflow.com/a/15509914/852208
Upvotes: 2
Reputation: 156978
Those assemblies are saved in the GAC.
Go to C:\Windows\assembly
, select those assemblies you want to get rid off, right-click and choose Uninstall
. Those assemblies will not get loaded any more by your program.
If you have to re-install them, they are still in the Oracle folder, so you can install it from there again using gacutil
.
Upvotes: 0