0

I am using 64bit Oracle.DataAccess.dll (64-bit ODAC 11.2 Release 6 (11.2.0.4.0) Xcopy for Windows x64). Downloaded this package ODAC112040Xcopy_64bit.zip from

http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html.

I want to connect to Oracle 11g Database using the provider dll. I was able to install it successfully. However, when I use the dll in my Asp.net code, I am getting following error.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Oracle.DataAccess, Version=2.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.

My system is a Windows 7, 64bit machine. Using Visual Studio 2015. Even before the program execution reaches the function calls of Oracle.DataAccess.dll, I get this error as soon as the page loads.

Have seen many blogs with answers saying, 64-bit dll being used on 32-bit machine or 32-bit enabled IIS Website etc. My requirement is, need only 64bit dll to be executed on 64bit machine.

Please let me know how to fix the issue.

1 Answers1

1

The error message says it is looking for Version=2.112.4.0, which is for .net 2 (and 3). The title of your post mentions .net 4.6, so you should be targeting Version=4.112.4.0 in your visual studio project

JGH
  • 15,928
  • 4
  • 31
  • 48
  • The package "ODAC112040Xcopy_64bit.zip" will always publish / register the Oracle.DataAccess.dll component with version Version=2.112.4.0. Even after manually registering the Version=4.112.4.0, when i see the GAC (c:\windows\assembly), I see only Version=2.112.4.0 is present. – Karthik Kumar K V May 17 '17 at 21:27
  • The GAC for .net CLR 2 and 4 are different, see more [here](http://stackoverflow.com/questions/2660355/net-4-0-has-a-new-gac-why). But the GAC is out of the question at this point. Your app will search for whatever version you have instructed it to look for, which is v2. In your visual studio project, look for (= browse and add the reference) the v4 dll. – JGH May 18 '17 at 00:47
  • Yes, i have already have those in place. Checked the references once again In my Solution I do add v4 version. However, still the app when browsed from IIS and IDE, still looking for v2 version of the dll. – Karthik Kumar K V May 18 '17 at 20:22