Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaffold-DbContext doesn't work #19

Open
geertsj opened this issue Feb 18, 2021 · 2 comments
Open

Scaffold-DbContext doesn't work #19

geertsj opened this issue Feb 18, 2021 · 2 comments

Comments

@geertsj
Copy link

geertsj commented Feb 18, 2021

Hi,

I have running an OpenEdge V12.1 database called stb. I have started VS2019, made 1 solution with some projects and I have done some Install-Package statements in the Nuget packagemanager, so far so good no problem.

I want to generate automatically the classes for my tables in database stb. I run the following in Package Manager console:

Scaffold-DbContext "Driver=Progress OpenEdge 12.1 Driver;HOST=localhost;port=12000;UID=GEERTJ01;PWD=JG1312;DIL=1;Database=stb" EntityFrameworkCore.OpenEdge -OutputDir Models

The following output appears:

Build started...
Build succeeded.
System.TypeLoadException: Method 'Create' in type 'EntityFrameworkCore.OpenEdge.Scaffolding.Internal.OpenEdgeDatabaseModelFactory' from assembly 'EntityFrameworkCore.OpenEdge, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b11b5ededc51fdb3' does not have an implementation.
   at EntityFrameworkCore.OpenEdge.Design.Internal.OpenEdgeDesignTimeServices.ConfigureDesignTimeServices(IServiceCollection serviceCollection)
   at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.ConfigureDesignTimeServices(Type designTimeServicesType, IServiceCollection services)
   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 outputContextDir, String dbContextClassName, IEnumerable`1 schemas, IEnumerable`1 tables, String modelNamespace, String contextNamespace, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames, Boolean suppressOnConfiguring, Boolean noPluralize)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String outputDbContextDir, String dbContextClassName, IEnumerable`1 schemaFilters, IEnumerable`1 tableFilters, String modelNamespace, String contextNamespace, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames, Boolean suppressOnConfiguring, Boolean noPluarlize)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContext.<>c__DisplayClass0_0.<.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)
**Method 'Create' in type 'EntityFrameworkCore.OpenEdge.Scaffolding.Internal.OpenEdgeDatabaseModelFactory' from assembly 'EntityFrameworkCore.OpenEdge, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b11b5ededc51fdb3' does not have an implementation.**
PM> 

What is wrong here?
Do I have forgotten something?

The project .cproj file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="EntityFrameworkCore.OpenEdge" Version="1.0.12-rc3" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.3" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.3">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.3" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.3">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>

</Project>

Thanks in advance.

Johan Geerts
Progress Developer Axians

@alexwiese
Copy link
Owner

@geertsj the provider currently does not support EF Core 5.0.3
Sorry but I simply haven't had time to update it and moving from 2.x to 3.x there were some big changes that I need to address.
Feel free to submit a PR to update to 5.x but in the meantime you can only use EF Core 2.x

@geertsj
Copy link
Author

geertsj commented Feb 19, 2021

Hi Alex,

Clear! With the packages EntityFrameworkCore.OpenEdge 1.0.12-rc3 and Microsoft.EntityFrameworkCore.Design 2.1.14 it is succeeded to scaffold my Progess database to classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants