Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception calling "Remove" with "0" argument(s): "The given key was not present in the dictionary

I have added a migration using Add-Migration, Now If I run Remove-Migration, it reverts the migration and remove the generated migration file successfully, but gives the error in Package Manager Console also. I could not figure out the exact reason behind it and side effect of it. Is this EF Core bug?

Package Manager Output:

PM> Remove-Migration Removing migration '20180320052521_testMigration'. Reverting model snapshot. Done. Exception calling "Remove" with "0" argument(s): "The given key was not present in the dictionary." PM>

EF Core Version: 2.0.1

like image 780
vivek nuna Avatar asked Mar 20 '18 05:03

vivek nuna


1 Answers

The Application is always building when a migration is added to the Project as mentioned in the previous answers.

This one is not actually a Solution, its more a workaround which is working for me at most.

Try to remove your Migration mit following Command

Remove-Migration NameOfMigration
like image 178
Lars Avatar answered Oct 22 '22 20:10

Lars