update-database error - NuGet Package (EntityFramework.SqlMigrations)

£可爱£侵袭症+ 提交于 2019-11-30 17:58:44

Occurs with EF5 RTM, VS2012 RTM.

I experienced this problem today. I executed "Update-Package EntityFramework" in the PM Console. No changes were reported by NuGet and the problem persisted. I then restarted VS2012 and re-attempted Update-Database and it worked as expected. It's not clear what caused this problem, it's also not clear whether the Update-Package contributed to correcting it or not.

First try restarting Visual Studio, then try Update-Package EntityFramework followed by a restart.

I just used this command:

Update-Package EntityFramework -Reinstall

In my case, helped installing EntityFramework package first:

Install-Package EntityFramework

and then installing EntityFramework.Migrations again:

Install-Package EntityFramework.Migrations

Not the best solution but to get it to work again I had to re-install the EntityFramework.Migrations package. After it had reapplied the Init.ps1 it remembered all the commands.

After trying everything else, the only way I could get my EntityFramework Migrations commands back was to run the following from the "Package Manager Console":

Import-Module \*PathToSolution*\packages\EntityFramework.5.0.0-beta2\tools\EntityFramework.psd1

After running the above, Add-Migration, Update-Database, etc. was available again.

For me the problem was the Nuget version.

  1. uninstall Nuget Package Manager.
  2. restart Visual Studio.
  3. installed new version of Nuget Package Manager.
  4. then re-start Visual Studio again

Restarting Visual Studio solved the problem for me...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!