I am connecting to oracle using ODP.NET. My testing server has two versions of Oracle(v4 and v2) installed. I have a third party application which is connected to one version(v4) and my application is connected to the other(v2).
When I run my application using a Visual studio, it works perfectly without any errors. But, when I publish and run from IIS it throws error saying
Could not load file or assembly 'Oracle.DataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
If I place the Oracle dll with version 4.1 it will start to show a different error
Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format.
How to fix this issue without removing(uninstalling) oracle from the machine?
NOTE: In current scenario, oracle versions cannot be removed from the server. So, both version will remain installed.
The first error message tells you didn't install the proper version of the Oracle Data client. It was looking for Oracle.DataAccess, Version=4.121.1.0
but it wasn't there.
The second error message tells you it is there now, but it tries to load a different architecture (that is: you installed 32-bit while the process is 64-bit or the other way around).
There are several fixes:
User contributions licensed under CC BY-SA 3.0