2013-10-01 2 views
1

У меня есть .NET 4.0 с ODAC 11.2.0.3.20 (ODP.NET 2.112.3.0), используя проект инфраструктуры Entity, который работает правильно на localhost.Поддерживает ли ODAC 11.2.0.1.2 (ODP.NET 2.112.1.2) платформу .NET Entity Framework?

Я почесал голову над этой проблемой. Я продолжаю сталкиваться с этой проблемой на нашем новом сервере IIS 7.5 с установленным ODAC 11.2.0.1.2 (ODP.NET 2.112.1.2).

Я думаю, что это потому, что ODP.NET 2.112.1.2 не поддерживает Entity Framework. Мой старый код, не использующий EF, по-прежнему работает, но как только я ударил EF-код, он ломается.

Администратор не хочет обновлять ODP.NET. Как заставить мой сайт работать на этом сервере? Благодаря

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 

вот web.config

ответ

1

Entity Framework поддержки в ODAC, кажется, первым доступен в 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.

Если ваш среда не может быть обновлена ​​до более поздней версии ODAC, вам, возможно, придется вернуться к не-EF-коду. Я предполагаю, что среда, которую вы рекламируете, является общей средой, которая будет рационализировать сопротивление администратора.

+1

Или используйте управляемый драйвер ODP.net для вашего EF-кода. – Jesse

+0

Спасибо, что предложили использовать управляемый драйвер. Я попытался переключиться на управляемый драйвер без успеха. Здесь я задал еще один вопрос. http://stackoverflow.com/questions/19231417/how-to-switch-my-project-from-using-unmanaged-to-managed-odp-net – imObjCSwifting

Смежные вопросы