3

Is there any way to make my .NET application use either 32 bit or 64 bit reference, depending on whichever one is available on the running environment?

I've a MSIL built application that currently references the 32-bit version of Oracle.DataAccess, because that's the version installed on my machine. Problem is, some machines only have 64-bit Oracle.DataAccess installed. Is there a way to set my application so that it dynamically references the available dll, regardless of its word size?

painiyff
  • 2,519
  • 6
  • 21
  • 29
  • Possibly a duplicate of http://stackoverflow.com/questions/108971/using-side-by-side-assemblies-to-load-the-x64-or-x32-version-of-a-dll – torvin Sep 24 '15 at 00:26
  • You have to provide two versions of your application, one for 32 bit and one for 64 bit (I think it is the more common way of doing it, as you see also on many download pages in the internet). In order to compile both of them you should install both versions of Oracle Client on your developing machine. Here is a guideline how to do that: [Install Oracle x86 and x64](http://stackoverflow.com/questions/24104210/badimageformatexception-this-will-occur-when-running-in-64-bit-mode-with-the-32#24120100) – Wernfried Domscheit Sep 24 '15 at 09:15
  • 1
    Right, I'm fully aware I can distribute both 32 and 64 bit versions of the application, but that's exactly what I wanted to avoid. I would like to keep the application MSIL, if possible. – painiyff Sep 24 '15 at 22:54

1 Answers1

0

Have you tried using the Managed Oracle Data Provider (ODP) for .NET driver? I use it for all my .NET (3.x and 4.x) applications that communicate with an Oracle database. It and the Oracle Instance Client are simple to install and use via XCOPY or NUGET.

Erik Anderson
  • 4,915
  • 3
  • 31
  • 30