.net - app.config not working when adding DbProviderFactories entry for ODP.NET -


i try use oracle.manageddataaccess.client in application. added 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 .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 not contain oracle.manageddataaccess.client. when add same entry maschine.config (c:\windows\microsoft.net\framework\v4.0.30319\config) works fine.

<add name="odp.net, managed driver" invariant="oracle.manageddataaccess.client" description="oracle data provider .net, managed driver" type="oracle.manageddataaccess.client.oracleclientfactory, oracle.manageddataaccess, version=4.121.2.0, culture=neutral, publickeytoken=89b483f429c47342"/> 

that's way query dbproviders (but providers list not contain entry anyway):

datatable providers = dbproviderfactories.getfactoryclasses(); providers.select("invariantname = 'oracle.manageddataaccess.client'"); 

so why isn't application configuration used? want deploy application clients. not sure if can change maschine.config.

thanks help

update: found possible explanation: when embedded config (i when there no reason place config file beside exe) not work. when change config-type "nothing" , place them beside exe works fine.

with configuration worked:

<configuration>   <startup>     <supportedruntime version="v4.0" sku=".netframework,version=v4.5.2"/>   </startup>   <system.data>     <dbproviderfactories>       <remove invariant="oracle.manageddataaccess.client"/>       <add name="odp.net, managed driver" invariant="oracle.manageddataaccess.client" description="oracle data provider .net, managed driver"         type="oracle.manageddataaccess.client.oracleclientfactory, oracle.manageddataaccess, version=4.121.2.0, culture=neutral, publickeytoken=89b483f429c47342"/>     </dbproviderfactories>   </system.data>   <runtime>     <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">       <dependentassembly>         <publisherpolicy apply="no"/>         <assemblyidentity name="oracle.manageddataaccess" publickeytoken="89b483f429c47342" culture="neutral"/>         <bindingredirect oldversion="4.121.0.0 - 4.65535.65535.65535" newversion="4.121.2.0"/>       </dependentassembly>     </assemblybinding>   </runtime> </configuration> 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -