BizTalk Could not load file or assembly ‘Oracle.DataAccess, Version=2.111.7.0, Culture=neutral, PublicKeyToken=89b483f429c47342’ or one of its dependencies. The system cannot find the file specified.

Posted: August 21, 2014 in BizTalk
Tags: , , , , , , ,

Recently I work in a project when I need to communicate with Oracle database in which I encountered some platform configuration problems. In general, communicate with Oracle is very simple and somewhat similar to SQL Server.

In development phase I didn’t have any problem, but notice that before you start developing you need to make sure that you have BizTalk Adapter Pack installed and Oracle client (or at least Oracle Data Access Components (ODAC) – 32 and 64 bits) installed to use BizTalk Adapter for Oracle in your BizTalk environment.

The BizTalk Adapter Pack consists of the following adapters:

  • Microsoft BizTalk Adapter for Oracle Database (Oracle Database adapter).
  • Microsoft BizTalk Adapter for Oracle E-Business Suite (Oracle E-Business adapter).
  • Microsoft BizTalk Adapter for mySAP Business Suite (SAP adapter). This also includes the .NET Framework Data Provider for mySAP Business Suite (Data Provider for SAP).
  • Microsoft BizTalk Adapter for Siebel eBusiness Applications (Siebel adapter). This also includes the .NET Framework Data Provider for Siebel eBusiness Applications (Data Provider for Siebel).
  • Microsoft BizTalk Adapter for SQL Server (SQL adapter).

And you can found more information how to install it here: BizTalk 2013 Installation and Configuration – Installing BizTalk Adapter Pack (Part 12)

The Microsoft BizTalk Adapter for Oracle Database is a Windows Communication Foundation (WCF) custom binding. This binding contains a single custom transport binding element that enables communication with an Oracle database.

The following figure shows part of “BizTalk Oracle Adapter Architecture”:

BizTalk-Oracle-Adapter-Architecture

According to BizTalk official documentation, the support version of Oracle are:

  • Oracle database version 11.1,
  • Oracle database version 10.2,
  • Oracle database version 10.1,
  • Oracle database version 9.2

And supported client versions:

  • Oracle Data Access Components for Oracle Client 11.1.0.6 with Patch Set 11.1.0.7,
  • Oracle Data Access Components for Oracle Client 11.1.0.7

You can read more on how to install Oracle client here:

As I said earlier, I didn’t had any problem in development phase however in runtime I catch the following error:

The adapter failed to transmit message going to send port “SEND_Oracle” with URL “oracledb://connection”. It will be retransmitted after the retry interval specified for this Send Port. Details:”System.IO.FileNotFoundException: Could not load file or assembly ‘Oracle.DataAccess, Version=2.112.1.2, Culture=neutral, PublicKeyToken=89b483f429c47342’ or one of its dependencies. The system cannot find the file specified.

File name: ‘Oracle.DataAccess, Version=2.112.1.2, Culture=neutral, PublicKeyToken=89b483f429c47342’ —> System.IO.FileNotFoundException: Could not load file or assembly ‘Oracle.DataAccess, Version=2.111.7.0, Culture=neutral, PublicKeyToken=89b483f429c47342’ or one of its dependencies. The system cannot find the file specified.
File name: ‘Oracle.DataAccess, Version=2.111.7.0, Culture=neutral, PublicKeyToken=89b483f429c47342’
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.

So I tried to check in the GAC if the correct assemblies were there and I realized that the client add installed a different version of the Oracle Client: Oracle 11g R2.

BizTalk-Oracle-Client-GAC-dll

CAUSE

When installing the Oracle WCF Adapter for BizTalk there is a design time requirement to use Oracle.DataAccess Version 2.111.7.0.

Official the Oracle 11g R2 is not supported and again according to official documentation I should use one of the supported clients. However my client only had access to this version and did not want to use another. Although not officially supported you can connect to Oracle 11g R2 database and use Oracle 11g R2 client with minor configuration adjustments.

SOLUTION

One possible solution to fix this problem is configuring Assembly Binding Redirection in the machine configuration file (Machine.config):

  • 32-bit: c:\Windows\Microsoft.NET\Framework\[version]\config\machine.config
  • 64-bit: c:\Windows\Microsoft.NET\Framework64\[version]\config\machine.config

Note: You should apply this in both 32 and 64-bit machine configuration files.

By using the <assemblyBinding> Element for <runtime> that will contain all the information about assembly version redirection and the locations of assemblies.

In this case you should apply the following configurations:

<runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
        <assemblyIdentity name="Oracle.DataAccess"
          publicKeyToken="89b483f429c47342" />
 
        <bindingRedirect oldVersion="2.111.7.0" newVersion="2.112.1.2" />
      </dependentAssembly>
       </assemblyBinding>
</runtime>

Just to be sure, I add this configuration in both 32 and 64-bit in .NET Framework 2.0 and 4.0 machine configuration files.

Comments
  1. Roniraj Ghoshal says:

    Sandro,
    Could you please help me here as I’m still getting error after applying your fix.
    Old Error:
    —————————————————————————————————————————–
    The adapter failed to transmit message going to send port “WcfSendPort_OracleDBBinding_XXXXXXX” with URL “oracledb://DEV02/”. It will be retransmitted after the retry interval specified for this Send Port. Details:”System.IO.FileNotFoundException: Could not load file or assembly ‘Oracle.DataAccess, Version=2.111.7.0, Culture=neutral, PublicKeyToken=89b483f429c47342’ or one of its dependencies. The system cannot find the file specified.
    File name: ‘Oracle.DataAccess, Version=2.111.7.0, Culture=neutral, PublicKeyToken=89b483f429c47342’
    at Microsoft.Adapters.OracleDB.OracleDBBinding.Initialize()
    at Microsoft.Adapters.OracleDB.OracleDBBinding.CreateBindingElements()
    at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.InitializeValues(IBaseMessage message)
    at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfTransmitter`2.GetClientFromCache(String spid, IBaseMessage message)
    at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfAsyncBatch`2.BatchWorker(List`1 messages)

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
    “.
    —————————————————————————————————————————–

    After I added following redirection in 32bit and 64bit machine.config for framework 2.0 and 4.0

    New Error:
    —————————————————————————————————————————–
    The adapter failed to transmit message going to send port “WcfSendPort_OracleDBBinding_XXXXXXX” with URL “oracledb://DEV02/”. It will be retransmitted after the retry interval specified for this Send Port. Details:”System.IO.FileNotFoundException: Could not load file or assembly ‘Oracle.DataAccess, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342’ or one of its dependencies. The system cannot find the file specified.
    File name: ‘Oracle.DataAccess, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342’ —> System.IO.FileNotFoundException: Could not load file or assembly ‘Oracle.DataAccess, Version=2.111.7.0, Culture=neutral, PublicKeyToken=89b483f429c47342’ or one of its dependencies. The system cannot find the file specified.
    File name: ‘Oracle.DataAccess, Version=2.111.7.0, Culture=neutral, PublicKeyToken=89b483f429c47342’

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

    at Microsoft.Adapters.OracleDB.OracleDBBinding.Initialize()
    at Microsoft.Adapters.OracleDB.OracleDBBinding.CreateBindingElements()
    at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.InitializeValues(IBaseMessage message)
    at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfTransmitter`2.GetClientFromCache(String spid, IBaseMessage message)
    at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfAsyncBatch`2.BatchWorker(List`1 messages)

    “.
    —————————————————————————————————————————–

    • Hi Roniraj,

      Check on GAC what’s the Oracle.DataAccess version number that you have and them implement the solution provided in this post in both 32 and 64-bit in .NET Framework 2.0 and 4.0 machine configuration files.

      • Roniraj Ghoshal says:

        In GAC I see Oracle.DataAccess has 2.111.7.20 version. That’s why I added following in machine.config. Am I missing anything?

      • In which machine.config did you make this changes?

      • Roniraj Ghoshal says:

        I made these changes in Machine.config s located in the following file-folders..
        C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG
        C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config
        C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG
        C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config

      • Is the Oracle.DataAccess, Version=2.111.7.20 in GAC “C:\Windows\assembly”?
        And which Oracle client did you install? 32-bit or 64-bit or both?

  2. Roniraj Ghoshal says:

    Yes, Oracle.DataAccess, Version=2.111.7.20 is there in GAC “C:\Windows\assembly. I installed ODTwithODAC1110720 in my machine. It’s 32bit verion only.

  3. Ruth Resende says:

    Hey Guys. I’m facing the same problem. In my dev environment it is just fine. Biztalk 2013 R2, windows 7, SQL 2014 and ODAC1110720 32 version only. But in production does not work. Biztalk 2013 R2, windows 2012, SQL 2014 in multiple server.
    Sandro, Wich version of ODAC we have to install? Because the version ODAC1110720 does not have 64 version. My Oracle is 11 g. Thank you!

  4. Ruth Resende says:

    Hey! Never mind. I founded the problem. My dll ODAC1110720 is 32 version and It was running in a Host Instance of 64 bits. =/ Thank you!

  5. Johnny Boldt says:

    I still had the problem until I did a IISReset and restarted my host instances. That seemed to make BizTalk load my machine.config files.

  6. […] to assemblies for Oracle 11g – using 12c is possible, but, as Sandro Pereira points out, it requires editing machine.config.  SQL Server is fairly well supported out of the […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s