Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Following Introduction to Building Managed ODP.NET I get this error "Unrecognized configuration section oracle.manageddataaccess.client."

Following this tutorial, Introduction to Building ODP.NET, Managed Driver Applications

In the topic "Connect using the TNS_ADMIN Property", when I run I get "Unrecognized configuration section oracle.manageddataaccess.client" error.

like image 545
Andoni Ripoll Jarauta Avatar asked Dec 08 '25 13:12

Andoni Ripoll Jarauta


1 Answers

I ran into this issue myself in a multi-project solution including a Website. In my case, I have a "Data" project responsible for all Database interaction. It is in THIS project's App.config file that I needed to put my Oracle settings. In fact, the file was already prepared for me with the proper configSections to handle it.

Either way, this is how my App.config file looks now. Either add the missing configSections to your config file, or - if you have multiple projects - ensure you add the settings to the correct project's App.config file.

Your version numbers and PublicKeyTokens may vary.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="oracle.manageddataaccess.client"
      type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
  </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.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
    </DbProviderFactories>
  </system.data>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <publisherPolicy apply="no"/>
        <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/>
        <bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.1.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <oracle.manageddataaccess.client>
    <version number="*">
      <settings>
        <setting name="TNS_ADMIN" value="C:\Oracle\product\11.2.0\client_1\network\admin\" />
      </settings>
    </version>
  </oracle.manageddataaccess.client>
</configuration>
like image 154
Andrew S Avatar answered Dec 11 '25 05:12

Andrew S



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!