I want my application to use Oracle 11g ODAC, but it seems to be using those for 12c.... How can I force my application to use the 11g ODAC?
For some reason, I have following clients and ODT in my PC (Windows 7 Pro SP1 64-bit):
- Oracle 11g Client (64-bit) version 11.2.0.3.0
- Oracle 12c Client (64-bit) version 12.1.0.1.0
- Oracle 12c ODT (Oracle Developer Tools for Visual Studio) (32-bit)
And, my .net project (visual studio 2013) referes "Oracle.DataAccess.dll" which is stored in: C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess\v4.0_4.112.3.0__89b483f429c47342
The order of my environment path is like this:
C:\oracle12c\product\12.1.0\client_2;
C:\oracle12c\product\12.1.0\client_2\bin;
C:\oracle12c\product\12.1.0\client_1;
C:\oracle12c\product\12.1.0\client_1\bin;
C:\Oracle\product\11.2.0\client_1;
C:\Oracle\product\11.2.0\client_1\bin;
What I have tried is to specify dllPath in the web.config file like this:
<oracle.dataaccess.client>
<settings>
<add name="DllPath" value="C:\Oracle\product\11.2.0\client_1\bin"/>
</settings>
</oracle.dataaccess.client>
However, it does not work. When the constructor of OracleConnection class is called, I get the following error:
System.TypeInitializationException:
The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.
---> Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client
at Oracle.DataAccess.Client.OracleInit.Initialize()
at Oracle.DataAccess.Client.OracleConnection..cctor()
--- End of inner exception stack trace ---
Any information will be helpful. Thank you in advance!
--- UPDATE Oct 14 by Yukapod ---
I've found that my application does not require 12c ODT 32-bit version, so I removed it from my PC and tried again. However, the situation has not changed; I still get the "The provider is not compatible with the version of Oracle client" error just after the constructor of OracleConnection class is called. I'm wondering where the problem is....
I still have the following configuration in my web.config:
<oracle.dataaccess.client>
<settings>
<add name="DllPath" value="C:\Oracle\product\11.2.0\client_1\bin"/>
</settings>
</oracle.dataaccess.client>
And, this is my current environment PATH variable:
C:\oracle12c\product\12.1.0\client_1;
C:\oracle12c\product\12.1.0\client_1\bin;
C:\Oracle\product\11.2.0\client_1;
C:\Oracle\product\11.2.0\client_1\bin;
where
C:\oracle12c\product\12.1.0\client_1
-> ORACLE_HOME for Oracle 12c Client (64-bit) version 12.1.0.1.0
Oracle\product\11.2.0\client_1
-> ORACLE HOME for Oracle 11g Client (64-bit) version 11.2.0.3.0
And even I reversed the order of the PATH variable (I mean, make 11g come first), the result did not change (still have the same error). If anyone knows something, any kind of information will be very helpful. Thank you in advance again!