Asked by:
The provider is not compatible with the version of Oracle client at Oracle.DataAccess.Client.OracleInit.Initialize()

Question
-
User-1205505670 posted
Hello,
For last 20 days i am trying to find out a solution for the Oracle error "The provider is not compatible with the version of Oracle client". I had gone through some forums and follow the possibilities but still it is not resolved. Could anyone please provide a solution for this?
General Info:-
OS in Server:- Windows 2012 R2
Service pack:- No service pack
System type:- 64bit operating system
Oracle Client version:- 11.1.0
ODAC version:- ODAC1110720Xcopy
Oracle.Dataaccess.dll versions available in GAC :- 2.111.7.20, 1.111.6.0, 1.111.6.0
I have a service running in the server which uses the provider Oracle.dataaccess to get the data from Oracle db.Application wise i am using 2.111.7.20 version of Oracle.Dataaccess DLL but it was not included in the MSI. While calling the service method i am getting this error intermittently.
Workaround i have done so far:-
1) Copied the oracle.dataaccess.dll in the bin folder of the application
2) Copied the unmanaged Dll's of ODP.net like Oraops.dll to bin folder of the application.
3) Tried "dependent Assembly" configuration in web.config to redirect the oracle.dataaccess dll to 2.111.7.20 version .
4) Uninstall the other versions of Oracle.dataaccess.dll from GAC.
Error deatils:-
Message=Apollo.MessageCenter.Core.Model.Utility.CircuitBreakerTrippedException: An exception has tripped the circuit breaker. from Half-Open ---> System.Web.Services.Protocols.SoapException: There was a problem with the GetMessageCenterMessages() method. Details: The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Data.Database, SDWSproc]) failed: Exception has been thrown by the target of an invocation. (Strategy type ConfiguredObjectStrategy, index 2) ---> Microsoft.Practices.ObjectBuilder2.BuildFailedException: The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Data.Database, SDWSproc]) failed: Exception has been thrown by the target of an invocation. (Strategy type ConfiguredObjectStrategy, index 2) ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleClientFactory' threw an exception. ---> Oracle.DataAccess.Client.OracleException The provider is not compatible with the version of Oracle client at Oracle.DataAccess.Client.OracleInit.Initialize()
at Oracle.DataAccess.Client.OracleClientFactory..cctor()
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.RuntimeFieldHandle.GetValue(Object instance, RuntimeTypeHandle fieldType, RuntimeTypeHandle declaringType, Boolean& domainInitialized)
at System.Reflection.RtFieldInfo.InternalGetValue(Object obj, Boolean doVisibilityCheck, Boolean doCheckConsistency)
at System.Reflection.RtFieldInfo.GetValue(Object obj)
at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)
at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.GetDefaultMapping(String name, String dbProviderName)
at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.GetProviderMapping(String name, String dbProviderName)
at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.PreBuildUp(IBuilderContext context)
at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
--- End of inner exception stack trace ---
at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
at Microsoft.Practices.ObjectBuilder2.Builder.BuildUp(IReadWriteLocator locator, ILifetimeContainer lifetime, IPolicyList policies, IStrategyChain strategies, Object buildKey, Object existing)
at Microsoft.Practices.ObjectBuilder2.Builder.BuildUp[TTypeToBuild](IReadWriteLocator locator, ILifetimeContainer lifetime, IPolicyList policies, IStrategyChain strategies, Object buildKey, Object existing)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](IReadWriteLocator locator, ILifetimeContainer lifetimeContainer, String id, IConfigurationSource configurationSource)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](String id, IConfigurationSource configurationSource)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.NameTypeFactoryBase`1.Create(String name)
at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase(String name)
at Apollo.MessageCenter.Core.DAL.MessageServiceData.GetMessageCenterMessages(List`1& messages, Int64 irn, Int64 siteId)
--- End of inner exception stack trace ---Tuesday, December 8, 2015 10:18 AM
All replies
-
User269602965 posted
What I do is
1. forget XCOPY and install the unmanaged ODP.net package 64-bit version which installs a client and the oracle DLLs, and install that in a NEW oracle home directory.
64-bit ODAC 12c Release 4 (12.1.0.2.4) for Windows x64
http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html
2. go to the oracle home for the new client > ODP>NET folder > then find my ODAC.dll
3. copy that into my bin folder of my app, make local reference and recompile
that usually works and bypasses the GAC dependency, and seems to ignore the older clients installed on server.
Tuesday, December 8, 2015 10:21 PM