Asp.Net Core 1.0.0: Npgsql.EntityFrameworkCore.PostgreSQL Migration error

asp.net-core c# entity-framework-core npgsql postgresql

Question

My Startup.cs:

    services.AddEntityFrameworkNpgsql()
    .AddDbContext<ApplicationDbContext>(o =>
        o.UseNpgsql(Configuration["Data:DefaultConnection:ConnectionString"]
    ));

My project.json:

"Npgsql.EntityFrameworkCore.PostgreSQL": "1.0.0",
"Microsoft.EntityFrameworkCore": "1.0.0",

My project's dotnet --version:

1.0.0-preview2-003121

Then dotnet ef migrations add Firstsays

The current CSharpMigrationOperationGenerator cannot scaffold operations of type 'Microsoft.EntityFrameworkCore.Migrations.Operations.NpgsqlCreatePostgresExtensionOperation'. Configure your services to use one that can.

How can I specify an appropriate generator? Or maybe I'm doing wrong somewhere? Thank you in advance

1
3
2/28/2017 11:15:49 AM

Accepted Answer

This is a bug in the Npgsql EFCore provider, and has already been fixed: https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/58. The next release will contain the fix.

3
7/2/2016 10:30:08 AM

Popular Answer

Depending upon the version, you may need to add "Npgsql.EntityFrameworkCore.PostgreSQL.Design": "1.0.1" to your project.json file to get this to work. See this issue comment



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow