I would like to know the best approach of publishing .NET applications using Oracle.DataAccess.
The server is Windows 2008 r2 and has both 32-Bit and 64-Bit Oracle clients installed.
I have been trying to solve this error for the last two days, to no evail. I am publishing using the File System, setting Any CPU for the platform target, and correctly referencing the local dll using the GAC path (C:\WINDOWS\Microsoft.NET\assembly\GAC_32\Oracle.DataAccess\v4.0_4.112.3.0__89b483f429c47342\Oracle.DataAccess.dll).
When I publish this application, I get this 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.
OR This one:
Could not load file or assembly ‘Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342’ or one of its dependencies. The system cannot find the file specified.
Depending on small changes in the publish settings.
I have also tried publishing using 32-Bit platform and setting the application pool to enable 32-bit applications, still with no success.
I do not want to copy the Oracle.DataAccess DLL manually, and I have nothing in the config file to point to the DLL.
I do have another application running on the server using the same .DLL but I want to come up with the proper way how to publish such applicaitons to avoid future problems, and I do not want to play the trial and error game to publish.
The issue, in my case was that the development machine had a more recent version than the server, and this caused issues. Once the development machine had the same oracle client, and the reference to the oracle data access dll was of the same version, there were no problems.