Wednesday, March 21, 2012

FileNotFoundException: Could not load file orassembly 'Oracle.DataAccess'

Wednesday, March 21, 2012 Posted by Andre Broers , , 13 comments
When running Oracle Applications on other machines as development, we run into problems with different versions of oracle client installations. This will result in the following error:
FileNotFoundException: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies

One solution is to look in the c:\windows\assemblies folder to look what version of odp.net oracle assemblies are installed. Now you can create a redirect in the app.config or web.config by adding the following piece of code after the <configSections> :

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

In line 5 you can give the oldVersion (or a range of versions) and the newVersion (which is the version installed in the Global Assembly Cache (c:\windows\assemblies))
You can add more redirects for other assemblies if you want.

13 comments:

  1. Thanks a lot for this fix! Working absolutely fine and saved my day!

    ReplyDelete
  2. Thanks for sharing this informative article to our vision.
    Regards.
    Oracle Apps Training in Chennai

    ReplyDelete
  3. This is my first time visit on your site and i have bookmark this for again visit. thanks a lot of for share a appreciable post ..
    http://hadooptraininginhyderabad.co.in/salesforce-training-in-hyderabad/

    ReplyDelete