AdoNetCore.AseClient icon indicating copy to clipboard operation
AdoNetCore.AseClient copied to clipboard

Scaffold-DbContext not working: Unable to find expected assembly attribute named DesignTimeProviderServicesAttribute

Open danim-hub opened this issue 4 years ago • 0 comments

Describe the bug Cannot run Scaffold-Dbcontext

To Reproduce Create a new project with Microsoft.EntitFrameworkCore.Tools reference In PackageManager console, run: Scaffold-DbContext -Connection "Data Source=192.168.2.10;Port=3030;Database=mytestdb;Uid=testuser;Pwd=pa$$word" -Provider AdoNetCore.AseClient -Project MyProject -StartupProject MyProject Build started... Build succeeded. System.InvalidOperationException: Unable to find expected assembly attribute named DesignTimeProviderServicesAttribute in provider assembly AdoNetCore.AseClient. This attribute is required to identify the class which acts as the design-time service provider factory. 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, IEnumerable1 schemas, IEnumerable1 tables, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String outputDbContextDir, String dbContextClassName, IEnumerable1 schemaFilters, IEnumerable1 tableFilters, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames) 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) Unable to find expected assembly attribute named DesignTimeProviderServicesAttribute in provider assembly AdoNetCore.AseClient. This attribute is required to identify the class which acts as the design-time service provider factory.

Expected behavior The Scaffold-DbContext should create my model and dbcontext from existing tables in the database

Environment

  • netcore 3.1
  • visual studio 16.8.4
  • Microsoft.EntityFrameworkCore 3.1.12
  • AdoNetCore.AseClient 0.19.2

Additional context Add any other context about the problem here.

danim-hub avatar Feb 21 '21 20:02 danim-hub