Reputation: 141
after updating the Oracle.ManagedDataAccess dll from version 4.121.1.0 to version 4.121.2.0, since I could not save values of type CLOB in the previous version using NHibernate, on the client machine it gave this error: System.TypeInitializationException: The type initializer for 'OracleInternal.Common.ProviderConfig' threw an exception. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Section or group name 'oracle.manageddataaccess.client' is already defined. Updates to this may only occur at the configuration level where it is defined.
On my development machine this does not occur, I looked at the machine.config files of his machine and this section is not included, I already tried with and without the settings that Nuget added in the app.config, but nothing seems to work. Anyone know how I can resolve this? Thank you
Upvotes: 14
Views: 14768
Reputation: 434
I got this same error "The type initializer for 'OracleInternal.Common.ProviderConfig' threw an exception".
When I ran my app, in my Console error messages, "There is a duplicate 'oracle.manageddataaccess.client' section defined."
Turns out the definition for Oracle.ManagedDataAccess was in my WebAPI web.config and also the machine config.
Had to update THIS specific machine.config: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config - do a search on "managed" and comment out in 3 places.
Upvotes: 4
Reputation: 301
drop into the app.config and remove or comment this section:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- <configSections>
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
</configSections> -->
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<system.data>
Upvotes: 10
Reputation: 161
Remove the section with oracle.manageddataaccess.client from your machine.config.
The readme from the NuGet Package tells you to do so.
Upvotes: 14