Entity Framework Core Database-First Tutorial - problem

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
jarun
Posts: 2
Joined: Fri 06 Oct 2017 05:21

Entity Framework Core Database-First Tutorial - problem

Post by jarun » Fri 06 Oct 2017 05:39

I installed trial versions when i trying to run EFCore (https://www.devart.com/dotconnect/oracl ... -Core.html), gets an exception. why?


PM> Install-Package Microsoft.EntityFrameworkCore.Tools
Restoring packages for C:\source\repos\ConsoleApp2\ConsoleApp2\ConsoleApp2.csproj...
Installing NuGet package Microsoft.EntityFrameworkCore.Tools 2.0.0.
Committing restore...
Writing lock file to disk. Path: C:\source\repos\ConsoleApp2\ConsoleApp2\obj\project.assets.json
Restore completed in 10,12 sec for C:\source\repos\ConsoleApp2\ConsoleApp2\ConsoleApp2.csproj.
Executing nuget actions took 98,88 ms
Time Elapsed: 00:00:11.2756671

PM> Install-Package Devart.Data.Oracle.EFCore.Design
Restoring packages for C:\source\repos\ConsoleApp2\ConsoleApp2\ConsoleApp2.csproj...
Installing NuGet package Devart.Data.Oracle.EFCore.Design 9.4.348.
Committing restore...
Writing lock file to disk. Path: C:\source\repos\ConsoleApp2\ConsoleApp2\obj\project.assets.json
Restore completed in 490,73 ms for C:\source\repos\ConsoleApp2\ConsoleApp2\ConsoleApp2.csproj.
Executing nuget actions took 107,25 ms
Time Elapsed: 00:00:01.7997470

PM> Scaffold-DbContext "User Id=xxxx;Password=xxxx;Data Source=ora;" Devart.Data.Oracle.Entity.EFCore -Schemas TEST -Tables DEPT,EMP
System.TypeLoadException: Could not load type 'Microsoft.EntityFrameworkCore.Infrastructure.DesignTimeProviderServicesAttribute' from assembly 'Microsoft.EntityFrameworkCore, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)
at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)
at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](Assembly element)
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.ConfigureProviderServices(String provider, IServiceCollection services, Boolean throwOnError)
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.Build(String provider)
at Microsoft.EntityFrameworkCore.Design.Internal.DatabaseOperations.ScaffoldContext(String provider, String connectionString, String outputDir, String dbContextClassName, IEnumerable`1 schemas, IEnumerable`1 tables, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String dbContextClassName, IEnumerable`1 schemaFilters, IEnumerable`1 tableFilters, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContext.<>c__DisplayClass0_1.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Could not load type 'Microsoft.EntityFrameworkCore.Infrastructure.DesignTimeProviderServicesAttribute' from assembly 'Microsoft.EntityFrameworkCore, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
PM>

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

Re: Entity Framework Core Database-First Tutorial - problem

Post by Shalex » Mon 09 Oct 2017 14:48

dotConnect for Oracle supports only EF Core 1.1.2 at the moment. We will notify you when EF Core 2.0 and .NET Core 2.0 are supported.

jarun wrote:PM> Install-Package Microsoft.EntityFrameworkCore.Tools
Restoring packages for C:\source\repos\ConsoleApp2\ConsoleApp2\ConsoleApp2.csproj...
Installing NuGet package Microsoft.EntityFrameworkCore.Tools 2.0.0.
As a temporary workaround, please use EF Core 1.1.2:
PM> Install-Package Microsoft.EntityFrameworkCore.Tools -version 1.1.2

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

Re: Entity Framework Core Database-First Tutorial - problem

Post by Shalex » Mon 30 Oct 2017 20:03

.NET Core 2.0 and EF Core 2.0 are supported: viewtopic.php?f=1&t=36128.

Be aware that starting from Entity Framework Core 2.0 the Scaffold-DbContext functionality (Devart.Data.Oracle.EFCore.Design.dll) is included in the Devart.Data.Oracle.EFCore package.

Post Reply