entity-framework - 更新数据库错误 - NuGet 包 (EntityFramework.SqlMigrations)

标签 entity-framework nuget-package entity-framework-migrations

我安装了 EntityFramework.SqlMigrations NuGet 包
我得到这个错误。
它过去对我有用,不知何故,现在它不起作用。

PM> update-database
The term 'update-database' 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:16
+ update-database <<<< 
    + CategoryInfo          : ObjectNotFound: (update-database:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

最佳答案

发生于 EF5 RTM、VS2012 RTM .

我今天遇到了这个问题。我在 PM 控制台中执行了“Update-Package EntityFramework”。 NuGet 未报告任何更改,问题仍然存在。然后我重新启动 VS2012 并重新尝试更新数据库,它按预期工作。不清楚是什么导致了这个问题,也不清楚更新包是否有助于纠正它。

首先尝试重新启动 Visual Studio,然后尝试 Update-Package EntityFramework,然后重新启动。

关于entity-framework - 更新数据库错误 - NuGet 包 (EntityFramework.SqlMigrations),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7567657/

相关文章:

c# - Entity Framework : wrong return type of stored procedure

.net-core - 如何将引用的项目打包到 nuget 包中?

entity-framework - EF 5.0 枚举未生成

c# - 如何将Connection String中的 "Provider Name"添加到Context文件中?

c# - OData 中实体的别名/重命名属性

c# - 更新 EF 4.1 中的记录

c# - 如何在 EF Linq 中使用 MySQL 函数 'Date'

c#-4.0 - Ninject.Extensions.Logging.Log4net 意外行为

c# - 安装包 : Unable to find package 'CommonServiceLocator. MefAdapter

ef-code-first - EF核心错误-找不到项目。更改当前工作目录或使用--project选项