I have this issue, I'll try explain it
I use Windows Server 2012 x64.
I use Visual Studio 2012 32 bits.
I use ODP.NET x64 - Oracle.DataAccess 4.112.2.0.
I have installed too ODP.NET x86
I use Enterprise Library 5.0
I use EntLib Contrib - ODP.NET Provider https://entlibcontrib.codeplex.com/releases/view/69407
I have Unit Test Project , compiled by .NET 4.5, and Any CPU.
The test is OK, using x86 (32 bits) - ODP.NET driver.
Now, I use a WCF Service, hosted in IIS 8.5 - x64 - asp.net 4.5 (AppPool is x64)
The same dataaccess code that in my unit test, now I get a error
System.TypeInitializationException: The type initializer for
"The provider is not compatible with the version of Oracle client"
"Activation error occured while trying to get instance of type Database, key \"\"".
Inner exception:
{"Resolution of the dependency failed, type = \"Microsoft.Practices.EnterpriseLibrary.Data.Database\", name = \"(none)\".\r\nException occurred while: Calling constructor EntLibContrib.Data.OdpNet.OracleDatabase(System.String connectionString, System.Collections.Generic.IEnumerable`1[[EntLibContrib.Data.OdpNet.IOraclePackage, EntLibContrib.Data.OdpNet, Version=5.0.505.0, Culture=neutral, PublicKeyToken=null]] packages, Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.IDataInstrumentationProvider instrumentationProvider).\r\nException is: TypeInitializationException - The type initializer for 'EntLibContrib.Data.OdpNet.OracleDatabase' threw an exception.
What's about Ent Lib 5.0 and ODP.NET not managed (Oracle.DataAccess 4.112.2.0 compiled for .net 4.0 in x64) ? in ASP.NET 4.5 (.NET 4.5) in x64 ?
Any suggestions ?