Reputation: 5232
I am having trouble with Oracle 11 (32bit) versus Oracle 12 (64bit). As some platforms here still have 32-bit windows, we standardized using the 32-bit Oracle11. WinForms apps and Asp sites work fine in 32-bit mode on all our platforms.
Only my dev machine has both Oracle versions. I develop with VisualStudio 2015 and debug with IISExpress. However, when running IIS on my development machine, it tries to run the 64-bit Oracle 12, and throws an exception Oracle.DataAccess.Client: the provider is not compatible with the version of Oracle Client.
Uninstalling the Oracle 12 seems complicated, so what I did was disable it by renaming that install dir to c:\oracle\product\12.1.0XXX
. Also, I removed the registry key HKLM/Software/Oracle
because it points to Oracle 12 and does not exist on the servers with only Oracle-11.
I also uninstalled the Oracle dll's for 2.121.2.0 from the GAC.
After reboot, the VS2015 and IISExpress still work OK with Oracle code, but using IIS I see the error: Unable to load DLL 'OraOps12.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
. This shows that IIS looks for the Oracle DDL in another place than IISExpress.
Oracle12 is mentioned in the PATH variable before Oracle11. As I don't know how to easily change the PATH today, in the old days it was set in autoexec.bat, I figured that by renaming the Oracle12 path, it was taken care of. An application will probe all directories mentioned in PATH, and if the Oracle12 directory does not exist, will continue looking at the next dir in PATH. However, if IIS is looking explicitly for OraOps12.dll
, it will never use Oracle11.
My question is how to get IIS to use the same Oracle DLL's as IISExpress?
Upvotes: 2
Views: 866
Reputation: 5232
Nothing worked, so I uninstalled the Oracle 12. That solved the issue.
The reason I tried to work around was that uninstalling Oracle 12 is very cumbersome. It is only possible to uninstall all Oracle, then reinstall the Oracle 11, where all steps are very slow. The whole job took about an hour and a half. Then it turned out I had dll version 2.112.1.0 instead of 2.111.7.20, so I had to replace references in several, but not all, projects in Visual Studio to be able to build.
The bottom line is that you should not try the 64 bit Oracle dlls from Oracle 12 in your C# Asp.Net projects. Just stick to the 32 bit Oracle 11, or you will regret.
Upvotes: 0