質問

I have a .NET 4.0 with ODAC 11.2.0.3.20 (ODP.NET 2.112.3.0) using Entity framework project running correctly on localhost.

I have been scratching my head over this issue. I keep running into this issue on our new IIS 7.5 server with ODAC 11.2.0.1.2 (ODP.NET 2.112.1.2) installed.

I think it is because ODP.NET 2.112.1.2 does not support Entity Framework. My old code not using EF still works but as soon as I hit EF code it breaks.

The admin doesn't want to update ODP.NET. How do I make my website work on this server? Thanks

    The provider is not compatible with the version of Oracle client

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client

Source Error: 


Line 22:         using (BOTEntities context = new BOTEntities())
Line 23:         {
Line 24:             var data = (from com in context.COMMITEETYPEs
Line 25:                        join comComp in context.COMMITTEECOMPs on com.COMMITEETYPEID equals comComp.COMMITTEEID
Line 26:                        where com.ACTIVE == 1

Source File: c:\xxxx\Competency\Competency.aspx.cs    Line: 24 

Stack Trace: 


[OracleException (0x80004005): The provider is not compatible with the version of Oracle client]
   Oracle.DataAccess.Client.OracleInit.Initialize() +750
   Oracle.DataAccess.Client.OracleClientFactory..cctor() +103

[TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleClientFactory' threw an exception.]

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeFieldHandle.GetValue(RtFieldInfo field, Object instance, RuntimeType fieldType, RuntimeType declaringType, Boolean& domainInitialized) +0
   System.Reflection.RtFieldInfo.UnsafeGetValue(Object obj) +124
   System.Reflection.RtFieldInfo.InternalGetValue(Object obj, StackCrawlMark& stackMark) +132
   System.Reflection.RtFieldInfo.GetValue(Object obj) +21
   System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow) +220
   System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +88
   System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +27
   System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +246
   System.Data.EntityClient.EntityConnection..ctor(String connectionString) +43
   System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection) +185
   System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config) +79
   System.Data.Entity.Internal.LazyInternalConnection.Initialize() +289
   System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() +36
   System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +286
   System.Data.Entity.Internal.InternalContext.Initialize() +31
   System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +39
   System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +137
   System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +38
   System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +84
   System.Linq.Queryable.Join(IQueryable`1 outer, IEnumerable`1 inner, Expression`1 outerKeySelector, Expression`1 innerKeySelector, Expression`1 resultSelector) +96
   Competency_Competency.fillPage() in c:\websites\Trustees4.0\BOT\ipad\Competency\Competency.aspx.cs:24
   Competency_Competency.Page_Load(Object sender, EventArgs e) in c:\websites\Trustees4.0\BOT\ipad\Competency\Competency.aspx.cs:15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
   System.Web.UI.Control.OnLoad(EventArgs e) +92
   System.Web.UI.Control.LoadRecursive() +54
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18044

here is the web.config

役に立ちましたか?

解決

Entity Framework support in ODAC appears to be first available in 11.2.0.3.0:

ODP.NET 11.2.0.3.0, and higher, includes support for the ADO.NET Entity Framework and LINQ to Entities. ODP.NET also supports Entity SQL.

If your environment cannot be updated to a later version of ODAC, you may have to revert to non-EF code. I'm guessing the environment that you're promoting to is a shared environment, which would rationalize the administrator's resistance.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top