There is already an object named 'AspNetRoles' in the database

前端 未结 6 1874
南笙
南笙 2020-11-30 23:28

Some time ago, I created a ASP.NET MVC 5 website with the Identity 1.0 version, and i created the Identity tables with this project. Now i have to make other website using t

6条回答
  •  自闭症患者
    2020-11-30 23:40

    For me, the problem couldn't be fixed by adding an empty migration. My problem was that the __EFMigrationsHistory table had been manually cleared. As a consequence, the context.Database.Migrate() method thought it had to apply all the missing migrations (missing entries in __EFMigrationsHistory). Simply add all the missing migrations in the db table and it should work again.

提交回复
热议问题