Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

OPD.Net: Running newer version than what is installed on the server (Having Issues - Need Help).

80s RockerFeb 8 2015 — edited Feb 9 2015

ODP.Net

We installed ODP.Net 4.121.1.0 on our IIS servers, so the following entries were made in the machine.config.  We also have the TNS_Admin environmental variable setup on all the servers

<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral,

              PublicKeyToken=89b483f429c47342" />

<DbProviderFactories>

      <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.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />

</DbProviderFactories>

<oracle.manageddataaccess.client>

    <version number="4.121.1.0">

      <settings>

        <setting name="tns_admin" value="d:\apps\oracle\odp.net\v121010\managed\x64\..\..\..\network\admin" />

      </settings>

    </version>

  </oracle.manageddataaccess.client>


In our application we wan to use the latest and greatest version 4.121.2.0.  So we installed ODP.Net using Nuget using "Install-Package Oracle.ManagedDataAcess", which is the official Oracle Nuget package.  This put the following entries in the application web.config.

<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral,

               PublicKeyToken=89b483f429c47342"/>

<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.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>

</DbProviderFactories>

<oracle.manageddataaccess.client>

    <version number="*">

      <dataSources />

    </version>

</oracle.manageddataaccess.client>


But with the following setup we get the following error: "There is a duplicate 'oracle.manageddataaccess.client' section defined".  We want our developers to be able to use the 4.121.1.0 version that is installed on the server by default, but we also want developers to be able to use the latest and greatest version of the ODP.Net driver by deploying it with their application if they want to.  Below are some things I tried to fix the error and the results I got.

  • If we remove <section> name entry in the web.config file the application seems to work. But if we do that, is it then using the other ODP.Net entries in the web.config for the 4.121.2.0 version (DBProviderFactory and oracle.manageddataaccess.client sections)?  IMO, I don't think this would be the case since the <section> entry in the machine.config is referencing version 4.121.1.0, so I would think it would use the sections in the machine.config, since those are the ones for 4.121.1.0.  Do we need to add a and assemblyBinding entry to make the driver use the 4.121.2.0 sections in the application web.config?

            <dependentAssembly>

                <assemblyIdentity name="oracle.manageddataaccess.client" publicKeyToken="89b483f429c47342"/>

                <bindingRedirect oldVersion="4.121.1.0-4.121.2.0" newVersion="4.121.2.0"/>

           </dependentAssembly>

  • I tried adding the a <remove name="oracle.manageddataaccess.client" to the application web.config, but then I got the following error: "Section or group name 'oracle.manageddataaccess.client' is already defined. Updates to this may only occur at the configuration level where it is defined."


The benefits of using the ODP.Net client is that it can be deployed with the application and not affect any other application on the server and you don't have to install the latest driver on the server or an application to use it.  So using a newer version of the ODP.Net driver by installing it in the application with nuget should work (but it looks like the nuget install assumes there are no ODP.Net drivers installed on the server).  So I just need to know what changes we need to make to the applications web.config files so that the application is using the ODP.Net driver that is deployed with the application, not the one that is installed on the server. Any help will be appreciated.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 9 2015
Added on Feb 8 2015
2 comments
5,586 views