asp.net-core - EF 7 Beta 8 -> EF7 RC1 - 不再可以创建迁移

标签 asp.net-core entity-framework-core

尝试将现有项目从 beta 8 更改为 RC1 后,我在运行 dnx ef migrations add Init 后得到以下信息

System.TypeLoadException: Could not load type 'Microsoft.Data.Entity.Scaffolding.SqliteDesignTimeServices, EntityFramework.Sqlite.Design'.
  at Microsoft.Data.Entity.Design.Internal.DesignTimeServicesBuilder.ConfigureProviderServices (System.String provider, IServiceCollection services, Boolean throwOnError) [0x00000] in <filename unknown>:0 
  at Microsoft.Data.Entity.Design.Internal.DesignTimeServicesBuilder.Build (Microsoft.Data.Entity.DbContext context) [0x00000] in <filename unknown>:0 
  at Microsoft.Data.Entity.Design.MigrationsOperations.AddMigration (System.String name, System.String outputDir, System.String contextType) [0x00000] in <filename unknown>:0 
  at Microsoft.Data.Entity.Commands.Program+Executor+<>c__DisplayClass6_0.<AddMigration>b__0 () [0x00000] in <filename unknown>:0 
  at Microsoft.Data.Entity.Commands.Program+Executor.Execute (System.Action action) [0x00000] in <filename unknown>:0 
Could not load type 'Microsoft.Data.Entity.Scaffolding.SqliteDesignTimeServices, EntityFramework.Sqlite.Design'.

我的 project.json文件与其他人一起包含以下内容
"dependencies": {
  "EntityFramework.Commands": "7.0.0-rc1-final",
  "EntityFramework.SQLite": "7.0.0-rc1-final"
},
"commands": {
  "ef": "EntityFramework.Commands"
},

我需要做什么来解决这个错误?

最佳答案

由于文件系统区分大小写,包名称在 Linux 和 OS X 上区分大小写。确保使用 EntityFramework.Sqlite不是 EntityFramework.SQLite在您的 project.json 文件。 (参见 GitHub 问题 dotnet/cli#236)

关于asp.net-core - EF 7 Beta 8 -> EF7 RC1 - 不再可以创建迁移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33845962/

相关文章:

asp.net-core - 如何覆盖默认的 Windows Authentiation ClaimsPrincipal User 和 Authorize Controller 方法属性

c# - ASP.NET Core 3 API 忽略带有 Bearertoken 的授权属性

c# - 如何使用 Fluent API 添加等效的所有者属性?

entity-framework-core - 映射 api 中的 EF Core 列名称

c# - OrderBy in Include child 使用 EF Core

c# - Entity Framework 7 FromSql 存储过程返回值

asp.net-core - 数据库中已经有一个名为 AspNetRoles 的对象。 ( Entity Framework 核心)

c# - EF核心: The instance of entity type cannot be tracked and context dependency injection

azure - Web App Bot 和 Azure Bot 有什么区别

c# - 检测到不支持的 .Net Core 3.0 可能的对象循环