尝试将现有项目从 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/