efcore.pg
efcore.pg copied to clipboard
Unable to scaffold dbcontext (Database First)
In my project.json,
"dependencies": {
"Microsoft.EntityFrameworkCore": "1.0.0-rc2-final",
"Npgsql.EntityFrameworkCore.PostgreSQL": "1.0.0-rc2-release1",
"Npgsql.EntityFrameworkCore.PostgreSQL.Design": "1.0.0-rc2-release1"
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview1-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
}
when i run at command prompt
dotnet ef dbcontext scaffold "<connection string>" Npgsql.EntityFrameworkCore.PostgreSQL.Design
I got this:
One or more errors occurred. (Unable to find expected assembly attribute named DesignTimeProviderServicesAttribute in provider assembly Npgsql.EntityFrameworkCore.PostgreSQL.Design. This attribute is required to identify the class which acts as the design-time service provider factory.)
The problem is that you specified Npgsql.EntityFrameworkCore.PostgreSQL.Design as your provider, this should be Npgsql.EntityFrameworkCore.PostgreSQL (see the EFCore getting started docs).