我正在使用实体框架数据迁移。如果我更改有关实体或其他内容的内容,我会尝试在包管理器控制台上使用“ add-migration MyFirstMigration ”。但它返回一个异常:
The term 'add-migration' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was inclu
ded, verify that the path is correct and try again.
At line:1 char:14
+ add-migration <<<<
+ CategoryInfo : ObjectNotFound: (add-migration:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
如果我从 Nuget 卸载 EntityFramework.Migrations 并重新安装它使用相同的代码(“ add-migration MyFirstMigration ”、“ update-database ”)直到关闭项目。
我该如何解决?还有其他人经历过吗?
编辑:顺便说一句,它在另一台电脑上工作正常......