我正在使用EF5 beta1,而我之前能够运行"更新数据库".现在我关闭了Visual Studio,我无法让它运行.我收到以下错误:
术语"更新 - 数据库"未被识别为cmdlet,函数,脚本文件或可操作程序的名称.检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试.在行:1 char:16 + Update-Database <<<< -verbose + CategoryInfo:ObjectNotFound:(Update-Database:String)[],CommandNotFoundException + FullyQualifiedErrorId:CommandNotFoundException
我试图重新安装EF5b1并且虽然成功(已安装),但"更新数据库"仍然无效.
谁能帮忙???
entity-framework ef-code-first ef-migrations entity-framework-5
我正在使用这个MSDN教程在VS2015 PM> Add-Migration MyFirstMigration -context BloggingContext中运行昨天成功运行的命令,但今天它给出了以下错误,这也是其他用户在这里指出的.我甚至从解决方案资源管理器中删除了Migrations文件夹,并从SQL Express 2014 on Win 8.1相同的错误中删除了相应的数据库 即使我跑,Add-Migration MyFirstMigration我得到同样的错误:
Add-Migration : 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 included, verify that the path is correct and try again.
At line:1 char:1
+ Add-Migration MyFirstMigration -context BloggingContext
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Add-Migration:String) [], CommandNotFoundException …Run Code Online (Sandbox Code Playgroud) PM> update-database
Build started...
Build succeeded.
The EF Core tools version '3.1.2' is older than that of the runtime '3.1.7'. Update the tools for the latest features and bug fixes.
Run Code Online (Sandbox Code Playgroud)
我尝试了本地更新。由于不同的项目可能在同一台机器上使用不同的版本。
如果我这样做
$ dotnet tool update dotnet-ef
Run Code Online (Sandbox Code Playgroud)
我收到此错误无法找到清单文件。
这是我的版本号:
$ dotnet ef --version
Entity Framework Core .NET Command-line Tools
3.1.5
Run Code Online (Sandbox Code Playgroud) 因此,从一天到第二天,我的迁移工作都停止了。我确实进行了迁移,并说它未被识别。我正在使用PM,因为这是asp.net mvc,并且在前一天工作。
add-migration:术语“ add-migration”不被视为cmdlet,函数,脚本文件或可运行程序的名称。检查名称的拼写,或者是否包含路径,请验证路径是否正确,然后重试。