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.