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

mor*_*hai 15 entity-framework nuget-package ef-migrations

我安装了EntityFramework.SqlMigrations NuGet Package,我收到此错误.它在过去和某种程度上对我有用,现在它不起作用.

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
Run Code Online (Sandbox Code Playgroud)

Sha*_*son 23

EF5 RTM,VS2012 RTM一起发生.

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

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

  • 刚重启对我有用,所以一定要先尝试一下 (3认同)