Entity Framework 6 Beta 1 / Oracle / Code First

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
rolandjoebstl
Posts: 3
Joined: Mon 27 May 2013 06:48

Entity Framework 6 Beta 1 / Oracle / Code First

Post by rolandjoebstl » Mon 01 Jul 2013 08:38

Hi,
I am testing the entity framework 6 Beta 1 with the dotconnect oracle 7.7 driver and I get the following exception at the application startup.

Code: Select all

Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "Ecolager.Client.WinForms.EcolagerMdi", name = "(none)".
Exception occurred while: Calling constructor Ecolager.Client.WinForms.EcolagerMdi(Ecolager.Data.DataFactory dataFactory).
Exception is: InvalidOperationException - The Entity Framework provider type 'Devart.Data.Oracle.OracleProviderFactory' for the 'Devart.Data.Oracle' ADO.NET provider could not be loaded. Make sure the provider assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
-----------------------------------------------
At the time of the exception, the container was:

  Resolving Ecolager.Client.WinForms.EcolagerMdi,(none)
  Calling constructor Ecolager.Client.WinForms.EcolagerMdi(Ecolager.Data.DataFactory dataFactory)
 ---> System.InvalidOperationException: The Entity Framework provider type 'Devart.Data.Oracle.OracleProviderFactory' for the 'Devart.Data.Oracle' ADO.NET provider could not be loaded. Make sure the provider assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
   bei System.Data.Entity.Config.ProviderServicesFactory.GetInstance(String providerTypeName, String providerInvariantName)
   bei System.Data.Entity.Internal.AppConfig.<.ctor>b__2(ProviderElement e)
   bei System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   bei System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   bei System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   bei System.Data.Entity.Internal.AppConfig.<.ctor>b__1()
   bei System.Lazy`1.CreateValue()
   bei System.Lazy`1.LazyInitValue()
   bei System.Lazy`1.get_Value()
   bei System.Data.Entity.Internal.AppConfig.get_DbProviderServices()
   bei System.Data.Entity.Config.AppConfigDependencyResolver.RegisterDbProviderServices()
   bei System.Data.Entity.Config.AppConfigDependencyResolver.GetServiceFactory(Type type, String name)
   bei System.Data.Entity.Config.AppConfigDependencyResolver.<>c__DisplayClass1.<GetService>b__0(Tuple`2 t)
   bei System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   bei System.Data.Entity.Config.AppConfigDependencyResolver.GetService(Type type, Object key)
   bei System.Data.Entity.Config.ResolverChain.<>c__DisplayClass3.<GetService>b__0(IDbDependencyResolver r)
   bei System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   bei System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   bei System.Data.Entity.Config.ResolverChain.GetService(Type type, Object key)
   bei System.Data.Entity.Config.CompositeResolver`2.GetService(Type type, Object key)
   bei System.Data.Entity.Config.IDbDependencyResolverExtensions.GetService[T](IDbDependencyResolver resolver, Object key)
   bei System.Data.Entity.Config.InternalConfiguration.GetService[TService](Object key)
   bei System.Data.Entity.Config.DbConfiguration.GetService[TService](Object key)
   bei System.Data.Entity.Config.DbConfiguration.GetService[TService]()
   bei System.Data.Entity.DbContext.InitializeLazyInternalContext(IInternalConnection internalConnection, DbCompiledModel model)
   bei System.Data.Entity.DbContext..ctor(String nameOrConnectionString)
   bei Ecolager.Data.EcolagerContext..ctor() in c:\Data\EcoLager\src\Ecolager.Data\EcolagerContext.cs:Zeile 22.
   bei Ecolager.Data.DataFactory.GetContext() in c:\Data\EcoLager\src\Ecolager.Data\DataFactory.cs:Zeile 102.
   bei Ecolager.Client.WinForms.EcolagerMdi..ctor(DataFactory dataFactory) in c:\Data\EcoLager\src\Ecolager.Client.WinForms\EcolagerMDI.cs:Zeile 61.
   bei lambda_method(Closure , IBuilderContext )
   bei Microsoft.Practices.ObjectBuilder2.DynamicBuildPlanGenerationContext.<>c__DisplayClass1.<GetBuildMethod>b__0(IBuilderContext context)
   bei Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context)
   bei Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context)
   bei Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
   bei Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
   bei Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, String name, IEnumerable`1 resolverOverrides)
   bei Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides)
   bei Microsoft.Practices.Unity.UnityContainerExtensions.Resolve[T](IUnityContainer container, ResolverOverride[] overrides)
   bei Ecolager.Client.WinForms.Program.Main() in c:\Data\EcoLager\src\EcolDer Thread 'vshost.RunParkingWindow' (0x1fb4) hat mit Code 0 (0x0) geendet.
Der Thread '<Kein Name>' (0x1c80) hat mit Code 0 (0x0) geendet.
Das Programm "[2980] Ecolager.Client.WinForms.vshost.exe: Verwaltet (v4.0.30319)" wurde mit Code 0 (0x0) beendet.
ager.Client.WinForms\Program.cs:Zeile 59.
My App.config looks like:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<configSections>
		<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
		...
	</configSections>
	<connectionStrings>
		<add name="EcolagerContext" connectionString="..." providerName="Devart.Data.Oracle" />
		<add name="Ecolager.Client.WinForms.Properties.Settings.ConnectionString" connectionString="..." providerName="Devart.Data.Oracle" />
	</connectionStrings>
	<system.data>
		<DbProviderFactories>
			<remove invariant="Devart.Data.Oracle" />
			<add name="dotConnect for Oracle" invariant="Devart.Data.Oracle" description="Devart dotConnect for Oracle" type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle, Version=7.7.267.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
		</DbProviderFactories>
	</system.data>
	<entityFramework>
		<providers>
			<provider invariantName="Devart.Data.Oracle" type="Devart.Data.Oracle.OracleProviderFactory" />
		</providers>
		<defaultConnectionFactory type="Devart.Data.Oracle.OracleProviderFactory, EntityFramework" />
	</entityFramework>
	<startup>
		<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
	</startup>
	...
</configuration>
With Entity Framework 5 the application starts without problems.

Does anybody have some ideas?

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: Entity Framework 6 Beta 1 / Oracle / Code First

Post by Shalex » Wed 03 Jul 2013 13:25

1. Please use

Code: Select all

   <entityFramework>
      <providers>
         <provider invariantName="Devart.Data.Oracle" type="Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity, Version=7.7.267.6, Culture=neutral, PublicKeyToken=09af7300eec23701" />
instead of

Code: Select all

   <entityFramework>
      <providers>
         <provider invariantName="Devart.Data.Oracle" type="Devart.Data.Oracle.OracleProviderFactory" />
2. Additionally, remove the following line from your *.config:

Code: Select all

      <defaultConnectionFactory type="Devart.Data.Oracle.OracleProviderFactory, EntityFramework" />

Post Reply