I try to use Oracle.ManagedDataAccess.Client in my application. I added this to my app.config (embedded resource):
<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>
The DBFactories list does not contain Oracle.ManagedDataAccess.Client. When I add the same entry to my maschine.config (C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config) it all works fine.
<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"/>
That's the way I query the DBProviders (but the providers list does not contain my entry anyway):
DataTable Providers = DbProviderFactories.GetFactoryClasses();
Providers.Select("InvariantName = 'Oracle.ManagedDataAccess.Client'");
So why isn't my application configuration used? I want to deploy my application to clients. I am not sure if I can change their maschine.config.
Thanks for your help
UPDATE: I finally found a possible explanation: when I embedded the config (I like to do that when there is no reason the place the config file beside the exe) it does not work. But when I change the config-type to "nothing" and place them beside the exe it all works fine.
With this configuration it finally worked: