-3

I am developing an application in ASP.NET when I start the project add an Oracle reference. DataAccess version 2.112.3.0 so far so good, the problem is when I try to replace that dll with another version 2.112.4.0, however much I give in removing reference and adding the new one, I still add the first one I add with the same path and the same version, they could help me how to remove it properly, the only way to replace the version is to change it directly in the bin folder when I already publish the application.
Greetings.

andres martinez
  • 281
  • 1
  • 4
  • 12
  • I would not provide a local copy of `Oracle.DataAccess.Client.dll`. Ask your customer to install on his machine an Oracle Client (needs to be done anyway) include the ODP.NET provider - then you are sure the versions will match. – Wernfried Domscheit Jan 14 '20 at 21:16
  • Have you tried using the [managed client for Oracle](https://www.nuget.org/packages/Oracle.ManagedDataAccess/)? It's self contained and does not need the full client installed on a client machine. – Fran Jan 15 '20 at 14:43
  • Hi @Fran If I have it installed in another project and it works perfectly, but in this case since it is a very old version of Oracle (Oracle 9i) it does not work because it does not support it. that's why I had to get the Oracle client 11.2 and grab the oracle.dataaccess dll – andres martinez Jan 15 '20 at 16:26
  • Does this answer your question? [Oracle.DataAccess assembly error when I publish the project on the server](https://stackoverflow.com/questions/59756347/oracle-dataaccess-assembly-error-when-i-publish-the-project-on-the-server) – Marco Aurelio Fernandez Reyes Jan 15 '20 at 19:13

1 Answers1

0

The version of Oracle.DataAccess.Client has to match exactly the version of installed Oracle Client, so a simple replace will not work anyway.

When a DLL is loaded then the application first looks into the GAC. If the DLL is not found there then the local folder is check. - Well, this is the very short version, the proper version you find at How the Runtime Locates Assemblies

Apart from that, your question is not really clear to me, what do you try to achieve and what is the problem? You may also edit your *.csproj/*.vbproj file with a text editor.

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
  • What happens is that one is 32bit and the other 64bit, previously had the 32bit client installed, but I changed it since the version of the client I had installed on the server did not work when I published the application told me that the version I was not compatible with the server (on my local machine if it worked with 32bits) what I did was change the client to 64bits so the 32 bit dll did not work with the client anymore. but when replacing the 32-dll with the 64-bit one, it doesn't change me, it keeps the first one that is the 32-bit one. – andres martinez Jan 14 '20 at 21:42
  • 2
    32-bit and 64-bit are completely independent from each other. You can work only in one architecture, .i.e. when you compile your application for x86 then Oracle.DataAccess.Client.dll and the Oracle also have to be 32-bit. When you compile at x64 or "AnyCPU" then (nowadays with 64-bit Windows) Oracle.DataAccess.Client.dll and the Oracle also have to be 64-bit. You cannot mix it. Only the ODP.NET Managed Driver works for any architecture. – Wernfried Domscheit Jan 15 '20 at 06:48
  • If you like to install both 32-bit and 64-bit Oracle Client on one machine follow this instruction: https://stackoverflow.com/questions/24104210/badimageformatexception-this-will-occur-when-running-in-64-bit-mode-with-the-32#24120100 – Wernfried Domscheit Jan 15 '20 at 06:48
  • compile the project to 64 bits and also add the 64 bit dll of Oracle.DataAccess, publish it on the server and send me a message: "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." – andres martinez Jan 15 '20 at 16:32