Nov 4, 2014 at 10:29 AM
Edited Nov 4, 2014 at 10:30 AM
I had a problem with ODP.Net causing Exceptions in the statement "EnterpriseLibrary...GetInstance<Database>(any value)" on a 64bit PC.
The solution was to add a DBProvideFactories entry below to my APP.CONFIG. However, the same code has to run on a 32bit desktop which does not have ODP.NET and when I run the code, I get a "System.TypeInitializationException". Is there a way I can
choose whether to run the <DBProviderFactories> elements e.g. IF statements in APP.CONFIG or put the whole thing in code?
<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=184.108.40.206, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
I'm not sure what type of application you have. However, one option is to use a different configuration file based on the build configuration.
looks like it could help for doing this with app.config. This would result in different deployment packages for x86 and x64. It also might be an option to select the proper configuration at install time depending on type of application (e.g.
If you want to have one package then you can also add DbProviderFactory programmatically. See:
Add a DbProviderFactory without an App.Config
Enterprise Library support engineer