我正在使用.NET 4.0项目。我安装了EF -version 6.0.0 nuget软件包。EF 6.0.0 - 从头创建数据库
我添加了一个类库,安装EF,然后启用迁移,添加我的DB Context类,和我的App.config里面,我说这个配置部分:当我运行应用程序
<contexts>
<context
type="DataLayer.MiddlewareDbContext, DataLayer">
<databaseInitializer
type="System.Data.Entity.MigrateDatabaseToLatestVersion`2[[
DataLayer.MiddlewareDbContext, DataLayer],
[DataLayer.Migrations.Configuration, DataLayer]], EntityFramework" />
</context>
</contexts>
,我得到以下例外,当我尝试访问DB语境:
Method not found: 'System.Data.Entity.Migrations.Model.ColumnModel System.Data.Entity.Migrations.Builders.ColumnBuilder.String(System.Nullable`1<Boolean>, System.Nullable`1<Int32>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.String, System.String, System.String, System.String, System.Collections.Generic.IDictionary`2<System.String,System.Data.Entity.Infrastructure.Annotations.AnnotationValues>)'.
还要注意,不被创建的数据库!
Migrations文件夹已经包含一个迁移文件,其中包含我拥有+ Configuration类的所有模型。
欣赏检查了这一点。
问候
您是否设法解决这个问题?我在迁移数据库时遇到了这个确切的错误。 –