1

Currently we have Oracle Client installed on our server VMs but we'd like to use Oracle Instant Client on Azure Service Fabric (without installation). I managed to get it work with version 11 but with v12 I'm still getting below error (far from connecting to database):

"The type initializer for 'Oracle.DataAccess.Client.OracleParameter' threw an exception: The provider is not comatibile with the version of Oracle client"

enter image description here

Again: it works without installation with Oracle.DataAccess.dll 4.112.3.0 and Instant Client 11.2.0.3 (both x32) but still can't get it to communicate with the newest versions.

I've worked with several Instant Client how-to articles but all of them are very old (~2013) with inactive links to Oracle downloads... Also I cannot use System.Data.OracleClient Namespace because it lacks a few functionalities we need (fe XxmlType or custom types) so I need to reference Oracle.DataAccess.dll

Here are steps I tried. Please point me what am I doing wrong...

  1. Downloaded and installed OracleClient 12.1.0.1.0 (Oracle.DataAccess.dll v4.121.1.0) - ODAC122010_x64

  2. Copied Oracle.DataAccess.dll from Oracle Home directory (whre it is installed) \odp.net\bin\4 to my project and referenced it

  3. Downloaded Instant Client from Oracle website. Version 12.1.0.1.0 - same as Oracle.DataAccess.dll Oracle download

  4. Added Instant Client dlls to project (Copy local: Always) Instant Client dlls

  5. Also I set up Environment like this:

    Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;
    
  6. Works locally (where Oracle is installed) but shows exception when published on Azure

kopieczek.dev
  • 706
  • 8
  • 26
  • `Oracle.DataAccess.dll` needs an Oracle Client to be installed. Did you install the Oracle Instant Client also on Azure? – Wernfried Domscheit Jul 18 '17 at 09:42
  • What is your `ORACLE_HOME` and which folder you have in your `PATH` environment? Perhaps your 4.121 version of `Oracle.DataAccess.dll` tries to access old Oracle 11 client due to wrong settings of these. – Wernfried Domscheit Jul 18 '17 at 09:45
  • I din't install it on Azure. Our goal is to have it running without need to install any Oracle client. I know it is possible - v11 runs fine in our different application (win forms) without installation – kopieczek.dev Jul 18 '17 at 13:36
  • 1
    Then you have to use the **ODP.NET, Managed Driver** (`Oracle.ManagedDataAccess.dll`), this does not require any further Oracle installation. `Oracle.DataAccess.dll` requires an Oracle client to be installed. – Wernfried Domscheit Jul 18 '17 at 13:38
  • 1
    As I wrote above - it works in our desktop application and now also in web app in Azure WITHOUT any installation. Unfortunately I managed it to work with 32bit Oracle.DataAccess.dll 4.112.3.0 and Instant Client 11.2.0.3 but still fails with the newest ones. – kopieczek.dev Jul 31 '17 at 08:54
  • Version of Oracle.DataAccess.dll and Oracle Client have to match, also the architecture (3bit vs. 64 bit) has to be the same. You have to align it, otherwise it does not work. – Wernfried Domscheit Jul 31 '17 at 09:34
  • All dll's are x64. At least I've downloaded them from x64 download site – kopieczek.dev Jul 31 '17 at 09:54
  • In order to run/install 32-bit and 64-bit Oracle client on one machine you have to make some special settings, follow this instruction: https://stackoverflow.com/questions/24104210/badimageformatexception-this-will-occur-when-running-in-64-bit-mode-with-the-32#24120100 – Wernfried Domscheit Jul 31 '17 at 10:13
  • But again - i didn't install any oracle client ;) – kopieczek.dev Jul 31 '17 at 12:10
  • But again - in this case Oracle.DataAccess.dll cannot work! – Wernfried Domscheit Jul 31 '17 at 12:14
  • Please describe what do you mean by "in this case" if it may bring anything to this conversation. Why v11 32bit works on clean machine without installation and v12 x64 not? – kopieczek.dev Jul 31 '17 at 18:24
  • As Wernfried suggested above, you really should switch to the [Managed Driver](https://www.nuget.org/packages/Oracle.ManagedDataAccess/). It requires no client be installed, has no difference between 32 and 64 bit, and makes life much easier. – mason Jul 31 '17 at 18:27
  • "in this case" means: in case you didn't install any oracle client Oracle.DataAccess.dll cannot work - believe it finally. – Wernfried Domscheit Jul 31 '17 at 20:04
  • Have also a look at this summary: https://stackoverflow.com/questions/659341/the-provider-is-not-compatible-with-the-version-of-oracle-client#25412992 – Wernfried Domscheit Jul 31 '17 at 20:30

0 Answers0