更新到AspNet.Identity后,实体框架migrate.exe无法正常工作

时间:2015-12-14 18:30:49

标签: asp.net-mvc entity-framework asp.net-identity dbcontext ef-migrations

由于更新我的解决方案以使用ASPNET Identity而不是旧的成员资格,因此更新数据库架构的migrate.exe命令停止工作。唯一的主要变化是我的Context现在继承自IdentityDbContext,当它从DbContext继承之前。

在程序包管理器控制台上运行update-database时一切正常,但在命令行上使用migrate.exe不再起作用。我收到错误:

System.Data.Entity.Migrations.Infrastructure.MigrationsException: No migrations configuration type was found in the assembly 'SampleProject.Repository.EF'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).

我有一个用于迁移的Configuration.cs文件,与往常一样,并且在运行" enable-migrations"建议我收到一条消息,说已经为项目启用了迁移。

有谁知道问题可能是什么?

谢谢

1 个答案:

答案 0 :(得分:0)

只需快速了解解决方案。 运行migrate.exe时是DLL版本冲突。 我正在使用我的web项目的输出(它还包含EF项目的DLL)。 我更新了它,以便使用我的EF项目的bin内容,它工作得很好。

相关问题