Leo Yao
Leo Yao

Reputation: 151

How can I specify the version of a reference to Oracle.DataAccess

I have installed 2 versions of ODAC (Oracle Data Access Client), so I can see there're two assemblies in the GAC. Now I am trying to use the old one which is 4.112.2.0, but no matter how I did, the version which is used is always the latest one (4.112.3.0). I even tried getting the assembly using the code below:

Assembly asb = Assembly.LoadFrom(@"Oracle.DataAccess.dll");
Console.WriteLine(asb.FullName);

However, I still saw the "4.112.3.0"... What's the problem here?

Thank you for any advice in advance.

Upvotes: 0

Views: 891

Answers (1)

IrishBoiler
IrishBoiler

Reputation: 55

  1. Add the correct version of ODAC to the project like normal (right-click on the references folder and go to add reference). Select and add the appropriate DLL.
  2. Now right-click on the reference in Solution Explorer and go to "Properties"
  3. Scroll down to "Specific Version" and change from "False" to "True"

This will cause Visual Studio to look for the specific version you added and will ignore any later versions. Make sure the version listed in the properties windows is correct and don't forget to make sure the path you added is accessible by the process running the applicable.

Upvotes: 1

Related Questions