BizTalk Server 2016: Could not load file or assembly “Oracle.DataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342” or one of its dependencies. The system cannot find the file specified.

  • Sandro Pereira
  • Oct 5, 2017
  • 3 min read

It is not the first time, nor will it be the last, that I have encountered similar problems like this one, or the same problem in earlier versions. We call it DLL hell (or nightmare), but I think all BizTalk Administrators are familiar with it and have been vaccinated against the problem. Some months ago, while trying to communicate with an Oracle database within Visual Studio in a brand-new BizTalk Server 2016 Developer environment to generate the proper Schemas, we faced with the following Oracle.DataAccess problem:

Error saving properties.
(System.ArgumentException) Invalid binding.
(System.IO.FileNotFoundException) Could not load file or assembly ‘Oracle.DataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342’ or one of its dependencies. The system cannot find the file specified.

Could not load file or assembly Oracle.DataAccess Version 4.121.1.0

📝 One-Minute Brief

A troubleshooting guide that explains why BizTalk Server 2016 fails with the error “Could not load file or assembly Oracle.DataAccess” when using the Oracle WCF adapter, and how to fix the issue using assembly binding redirection to align Oracle client versions.

Cause

When installing the Oracle WCF Adapter for BizTalk Server 2016, there is a design-time requirement to use Oracle.DataAccess Version 4.121.1.0.

BizTalk Server 2016 requires a specific Oracle.DataAccess version. However, we verified to the GAC that the DLL present in our environment had a different version.

Trying to find the correct ODP.NET 11.2.0.1.2 version under Oracle website can be a challenge

Note: depending on the BizTalk Server version that you are using, this the required Oracle.DataAccess version may change.

Solution

Trying to find the correct ODP.NET 11.2.0.1.2 version under the Oracle website can be a challenge, so one of the easiest and fastest ways to solve this problem is using 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>, which 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="4.121.1.0" newVersion="x.xxx.x.x" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>

By doing this, BizTalk Server will look to the Oracle.DataAccess version which not exists in your environment, it will be redirected to the existing DLL version.

For example, in our case, we used:

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

Just to be on the safe side, you should add this configuration to both 32-bit and 64-bit .NET Framework 2.0 and 4.0 machine configuration files.

#1 all-in-one platform for Microsoft BizTalk Server management and monitoring

Hope you find this helpful! If you liked the content or found it useful and would like to support me in writing more, consider buying (or helping to buy) a Star Wars Lego set for my son. 

Thanks for Buying me a coffe
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

8 thoughts on “BizTalk Server 2016: Could not load file or assembly “Oracle.DataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342” or one of its dependencies. The system cannot find the file specified.”

  1. Hello Sandro Pereira,

    We have installed BizTalk Server 2016 CU3 on Windows Server 2012 R2. We have installed Oracle DB client 12.1 64bit version. We are receiving same error message when we are trying to create a send port/Receive port for WCF-ORACLEDB adapter. We have made the changes suggested in the thread however still we are facing the same issue. Could you please let us know if we should also install Oracle client 12.1 32bit one too.

    Regards
    Sampath

    1. I suspect the BizTalk administration console requires the 32 bit version of the file. After installing and configuring the dll I was able to update the bindings

  2. Thanks Sandro. Are you running on Windows Server 2016? I followed your steps here, but I still can’t get it working with BizTalk 2016 on Windows Server 2016….

  3. Hi Sandro,

    I am getting this error at the first level/stage for developing project biztalk 2016.When i try to generate the schema by using oracleDbbinging Add =>Add generated item => consumeAdapterService. When I try to CONNECT, i get this error….
    I m worry, why i am getting this error at this stage.
    Please help me to solve the issue.

    (Connecting to the LOB system has failed.
    Could not load file or assembly ‘Oracle.DataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342’ or one of its dependencies. The system cannot find the file specified..)

  4. Hello, I am having a similar issue but I am unable to resolve it. I have followed the same steps you have mentioned here, Is there anything else I can look into ?

  5. I blog often and I genuinely thank you for your content. Your article has
    really peaked my interest. I will book mark your blog and
    keep checking for new information about once per week. I subscribed to your RSS feed too.

Leave a Reply

Your email address will not be published. Required fields are marked *

The Ultimate Cloud
Management Platform for Azure

Supercharge your Azure Cost Saving

Learn More
Turbo360 Widget

Back to Top