【发布时间】:2016-03-10 21:03:05
【问题描述】:
我正在使用实体框架数据迁移。如果我更改有关实体或其他内容的内容,我会尝试在包管理器控制台上使用“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") 直到关闭项目。
我该如何解决?其他人遇到过这种情况吗?
编辑:顺便说一句,它可以在另一台电脑上正常工作...
【问题讨论】:
-
我相信他们发布了一个新版本的 NuGet 来解决这个问题。
标签: entity-framework-4.1 data-migration entity-framework-migrations