简体   繁体   English

Asp.Net Core 1.0.0:Npgsql.EntityFrameworkCore.PostgreSQL迁移错误

[英]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.

相关问题 直接实例化Npgsql.EntityFrameworkCore.PostgreSQL的DbContext - Instantiate Npgsql.EntityFrameworkCore.PostgreSQL's DbContext directly npgsql.EntityFrameworkCore.PostgreSQL - 使用 json 参数执行 function 不起作用 - npgsql.EntityFrameworkCore.PostgreSQL - execute function with json parameter is not working 搭建 Npgsql.EntityFrameworkCore.PostgreSQL 数据库时出现 System.IO.EndOfStreamException - System.IO.EndOfStreamException when scaffolding Npgsql.EntityFrameworkCore.PostgreSQL database 带有 EntityFrameworkCore 的 ASP.NET Core 中的 SQLite - SQLite in ASP.NET Core with EntityFrameworkCore ASP.NET Core和Entityframwork迁移错误 - Asp.net core and Entityframwork migration error .NET Core Npgsql.EntityFrameworkCore ILikeExpression - .NET Core Npgsql.EntityFrameworkCore ILikeExpression 使用 Npgsql 将 PostgreSQL 与 ASP.NET MVC 连接 - Connecting PostgreSQL with ASP.NET MVC using Npgsql 如何从 ASP.NET Core 3.1 中的 EntityFrameworkCore 3 中删除依赖项 - How to remove dependency from EntityFrameworkCore 3 in ASP.NET core 3.1 在ASP.Net Core 1.0中注册通用EntityFrameworkCore DbContext - Register generic EntityFrameworkCore DbContext in ASP.Net Core 1.0 ASP.Net Core Npgsql操作已经在进行中 - ASP.Net Core Npgsql An operation is already in progress
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM