I have a VS 2012 Web Project Up. I have ODP.NET installed as we are an Oracle Workshop. I inherited a project that uses Oracle.ManagedAccess.Data and EF.
Upon running the project in VS 2012, I get the following error:
There is a duplicate 'oracle.manageddataaccess.client' section defined..
The solution was to disable the following line in web.config
<!--<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />-->
Which was fine. The project compiled but upon executing a simple command such as getting a password back where it has to read the database another error was tripped up:
System.Data.ConstraintException: Column 'InvariantName' is constrained to be unique. Value 'Oracle.ManagedDataAccess.Client' is already present.
Now I'm aware that the error is tripped up by ODP.NET and having it exist in the GAC thus the double error reporting.
Is there another line I should be commenting out or is there a way to disable ODP.NET briefly? I don't want to install that client as I use it for other projects.
thanks
Oracle Data Provider for . NET (ODP.NET) features optimized ADO.NET data access to the Oracle database. ODP.NET allows developers to take advantage of advanced Oracle database functionality, including Real Application Clusters, self-tuning statement cache, Application Continuity, and Fast Connection Failover.
Net native implementation of ODP.NET. That means no Oracle Client is needed, and now native code is behind the scenes.
I found the following on the Oracle site regarding the "There is a duplicate 'oracle.manageddataaccess.client' section defined.":
If your application is a web application and the above entry was added to a web.config and the same config section handler for "oracle.manageddataaccess.client" also exists in machine.config but the "Version" attribute values are different, an error message of "There is a duplicate 'oracle.manageddataaccess.client' section defined." may be observed at runtime. If so, the config section handler entry in the machine.config for "oracle.manageddataaccess.client" has to be removed from the machine.config for the web application to not encounter this error. But given that there may be other applications on the machine that depended on this entry in the machine.config, this config section handler entry may need to be moved to all of the application's .NET config file on that machine that depend on it.
I hope it helps.
I was getting the same error for an ASP.Net MVC project. I found that there is a version mismatch for oracle.manageddataaccess.client
in the Web.config
of the project, and machine.config
in
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config, and
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config.
I had Version=4.122.18.3
in the Web.config
and Version=4.122.1.0
in the machine.config
.
I updated the version(replaced Version=4.122.1.0
of oracle.manageddataaccess.client with 4.122.18.3
) in both the machine.config
, and the problem resolved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With