This discussion is archived
4 Replies Latest reply: Nov 1, 2012 4:55 PM by MikeB RSS

Could not load file or assembly Oracle.DataAccess

MikeB Newbie
Currently Being Moderated
I have a VB.Net application that has been running fine on a Windows 2003 32 bit server for many months. The exe has previously been compiled on a Vista 32 bit machine and then the exe was copied to the server. Today, I was issued a new Windows 7 64 bit machine. I installed the 32 bit ODAC 11.2.0 and added a reference to Oracle.DataAccess.dll in Visual Studio 2010. The program compiles and runs normally on my Windows 7 64 bit computer. In Visual Studio 2010 I have the "Target CPU" set to x86.

When I copy the exe to the 32 bit server, the following error is returned: "Could not load file or assembly Oracle.DataAccess".

The server has two 32 bit ODAC installations, 11.2.0.2 and 10.2.0. Why is this not working?

Edited by: MikeB on Nov 1, 2012 1:02 PM
  • 1. Re: Could not load file or assembly Oracle.DataAccess
    Mark Williams-Oracle Employee ACE
    Currently Being Moderated
    MikeB wrote:
    I have a VB.Net application that has been running fine on a Windows 2003 32 bit server for many months. The exe has previously been compiled on a Vista 32 bit machine and then the exe was copied to the server. Today, I was issued a new Windows 7 64 bit machine. I installed the 32 bit ODAC 11.2.0 and added a reference to Oracle.DataAccess.dll in Visual Studio 2010. The program compiles and runs normally on my Windows 7 64 bit computer. In Visual Studio 2010 I have the "Target CPU" set to x86.

    When I copy the exe to the 32 bit server, the following error is returned: "Could not load file or assembly Oracle.DataAccess".

    The server has two 32 bit ODAC installations, 11.2.0.2 and 10.2.0. Why is this not working?

    Edited by: MikeB on Nov 1, 2012 1:02 PM
    What's the full version of the Oracle.DataAccess assembly used to develop the application on your development machine?

    Is it a newer version than 11.2.0.2?
  • 2. Re: Could not load file or assembly Oracle.DataAccess
    MikeB Newbie
    Currently Being Moderated
    On the Windows 7 64 bit development machine, the version of Oracle.DataAccess in C:\Windows\assembly is 2.112.2.0

    On the Server 2003 32 bit machine, the version of Oracle.DataAccess in C:\Windows\assembly is 2.112.1.0

    Both of these were installed from the same installation file. I'm not sure why the version numbers are different.

    The Oracle Data Access Components for Oracle Client is 11.2.0.2.1

    Edited by: MikeB on Nov 1, 2012 3:27 PM
  • 3. Re: Could not load file or assembly Oracle.DataAccess
    Mark Williams-Oracle Employee ACE
    Currently Being Moderated
    It's been awhile since I have dealt with version issues so I'm a little fuzzy, but I think the issue here is that you are developing against a newer version (though only slightly) of the assembly than exists on the target deployment machine. There are policy files for redirecting older versions of the assembly to the latest version installed on the machine but that does not work for redirecting a newer version (i.e. 2.112.2.0) down (i.e. 2.112.1.0).
  • 4. Re: Could not load file or assembly Oracle.DataAccess
    MikeB Newbie
    Currently Being Moderated
    I was able to find an installation file for the Oracle Client 11.2.0.1.0. This installed version 2.112.1.0 of Oracle.DataAccess.dll on my development machine, which matches the server dll version. The application is running successfully after compiling it on the 64 bit computer and then running it on the 32 bit server.

    For anyone whos reads this in the future, you need to have the same version C:\Windows\assembly\Oracle.DataAccess.dll on both machines. And in my case, I needed to install the 32 bit Oracle Client on my 64 bit development machine in order to run the exe on the 32 bit server. I added a reference in Visual Studio to the 32 bit Oracle.DataAccess.dll, compiled and copied the exe to the server. The program is running normally.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points