Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly 'Oracle.ManagedDataAccess'

we are developing a windows service which connect to oracle database. We use Oracle ManagedDataAccess from Nuget package. When running the windows service we are receving below error. Tried to get details from stackoverflows and nothing is able to resolve the problem. Our config file is as below

Could not load file or assembly 'Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies

Config

<?xml version="1.0"?>
<configuration>
  <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <section name="eClaimsService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
      <section name="oracle.manageddataaccess.client"
      type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
    </sectionGroup>
  </configSections>
   <system.data>
    <DbProviderFactories>
      <remove invariant="Oracle.ManagedDataAccess.Client"/>
      <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver"
        type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
    </DbProviderFactories>
  </system.data>
  <system.web>
    <httpRuntime executionTimeout="3600" requestValidationMode="2.0" maxRequestLength="10240"/>
    <sessionState mode="InProc" timeout="60"/>
    <pages validateRequest="false" />
  </system.web>
</configuration>

like image 895
Sachu Avatar asked Oct 22 '25 02:10

Sachu


1 Answers

I got this error when my App.Config contained an old version of the DLL, I just removed this entry from the App.Config and it worked

like image 150
Chris Avatar answered Oct 24 '25 04:10

Chris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!