Our product uses ODP.NET 11g(11.2.0.4 to be specific). We want to upgrade to Oracle 12c but still want to support the previous version also(version with ODP.NET 11g). We have a couple of assemblies that uses Oracle.DataAccess.dll. while referencing these projects in visual studio, the setting "Specific Version" is set to false.
On a developer machine, when Oracle Client 12C is installed, the latest Oracle.dataaccess.dll files were picked up. This is because of the publisher policy that gets installed with the Oracle 12c client. I verified the path of the oracle.dataaccess,dll in visual studio for respective projects and it shows the path of the ODP.NET 12c client. This works seamlessly without any changes to the code.
Now we have problem getting this work on our build machine. The build machine has to build the 11g version and also the 12c versions of our product simultaneously.
We already have Oracle client 11.2.0.4 installed on the build machine. We had now installed the Oracle client 12c on the build machine. When I checked the references in visual studio, the oracle.dataaccess.dll path is updated to pick from odp.net 12c.
Following is my plan to deal with this issue. When I want to build the 11g version
- Remove the 12c related policy file and oracle.dataaccess dll from GAC.
- Remove the Oracleclient 12c path from the PATH Variable. The path already contains OracleClient 11g path. Removing the 12c path leaves the path variable with only Oracle client 11 path. I would do the reverse(uninstall 11g related dlls from GAC and install 12c dlls and add 12c Path to the Path environment variable)
But after following steps 1,2 for building 11g version, I still see the references in visual studio point to 12c version. Am I missing some thing Or I am completely on a wrong track?