[英]Asp.Net Core 1.0.0: Npgsql.EntityFrameworkCore.PostgreSQL Migration error
My Startup.cs
: 我的Startup.cs
:
services.AddEntityFrameworkNpgsql()
.AddDbContext<ApplicationDbContext>(o =>
o.UseNpgsql(Configuration["Data:DefaultConnection:ConnectionString"]
));
My project.json
: 我的project.json
:
"Npgsql.EntityFrameworkCore.PostgreSQL": "1.0.0",
"Microsoft.EntityFrameworkCore": "1.0.0",
My project's dotnet --version
: 我的项目的dotnet --version
:
1.0.0-preview2-003121 1.0.0-preview2-003121
Then dotnet ef migrations add First
says 然后dotnet ef migrations add First
说
The current CSharpMigrationOperationGenerator cannot scaffold operations of type 'Microsoft.EntityFrameworkCore.Migrations.Operations.NpgsqlCreatePostgresExtensionOperation'. 当前的CSharpMigrationOperationGenerator无法构建“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 先感谢您
This is a bug in the Npgsql EFCore provider, and has already been fixed: https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/58 . 这是Npgsql EFCore提供程序中的一个错误,并且已经修复: https : //github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/58 。 The next release will contain the fix. 下一个版本将包含修复程序。
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. 根据版本的不同,您可能需要在project.json
文件中添加"Npgsql.EntityFrameworkCore.PostgreSQL.Design": "1.0.1"
才能使其正常工作。 See this issue comment 请参阅此问题评论
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.