Thursday, 3 July 2014

Could not load file or assembly 'Oracle.DataAccess, Version=4.121.1.0


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.

It is problem due to application is not pointing to proper DDL of oracle access and your GAC is having different version of Oracle.DataAccess.

To correct this you just need to put the below code into web.config file.

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

By doing this when application is looking to the version which is not exist then it will redirect to the exist DLL version.

Generally by doing this you can work with the two same DDL with dirffrent version and based on the requirement you can call the version of DLL

1 comment:

  1. One condition for this issue arises when the when platform of the complied project has conflict with current platform setting in the iis. That like you said you are running on a 64bit machine and obviously your iis default setting will permit only 64bit applications on that. Since your ODP/application version is 32bit you need to override the default setting of iis to support 32bit version. Follow the below mentioned steps to enable 32bit environment on iis
    • Start iis manager by running “inetmgr” in run prompt
    • Expand localhost and select “Application Pools” under that
    • Select the “DefaultAppPool” under application pool
    • Click on advanced setting under actions tab
    • Set “Enable 32 Bit applications” to true in advanced settings
    • Click ok and restart iss

    ReplyDelete