It should be noted that <clear /> will clear all DbProviderFactories that you might not want to do, depending on your situation.
You can also just remove this class before re-adding it by adding this line:
<remove invariant="Oracle.ManagedDataAccess.Client" />
This is what the whole <system.data> would look like:
<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.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" /> </DbProviderFactories> </system.data>
This can be useful if your local and server environments do not have the appropriate configuration files, such as machine.config.
Another thing you could do is simply remove it from your web.config together, assuming the parameter in your machine.config will work. However, I would test this on both your development machine and your servers. In my case, he worked on one and not the other, because the machine.config files did not match. To solve this problem, I added this parameter to the machine.config file on the server without <remove invariant="Oracle.ManagedDataAccess.Client" /> , for example:
<system.data> <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.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" /> </DbProviderFactories> </system.data>
Tony L.
source share