When I run PM> Remove-Migration -context BloggingContext
in VS2015 with an ASP.NET Core project using EF Core I get the following error:
Syst
Simply you can target a Migration by value
Update-Database -Migration:0
Then go ahead and remove it
Remove-Migration
In Package Manager Console:
Update-Database Your_Migration_You_Want_To_Revert_To
More options and explanation on how to revert migrations can be seen here
You can still use the Update-Database
command.
Update-Database -Migration <migration name> -Context <context name>
However, judging by the name of your migration i'm assuming it's the first migration so that command may not work. You should be able to delete the entry from the __MigrationHistory
table in your database and then run the Remove-Migration
command again. You could also delete the migration file and just start again.
1.find table "dbo._EFMigrationsHistory", then delete the migration record that you want to remove. 2. run "remove-migration" in PM(Package Manager Console). Works for me.