The term 'Update-Database' is not recognized as the name of a cmdlet

前端 未结 26 828
无人共我
无人共我 2020-12-07 19:35

I am using EF5 beta1 and while I was able to run the \"Update-Database\" before. Now that I shut down Visual Studio, I cannot get it to run. I get the following error:

相关标签:
26条回答
  • 2020-12-07 20:00

    I've been having this problem a number of times lately. I found the solution that worked was to close the Package Manager Console, close Visual Studio and then reopen them. Rebooting also worked most of the time, but not always.

    0 讨论(0)
  • 2020-12-07 20:01

    I found that it was due to a corrupt package. I had installed Automapper when it was already installed. It was only clear that this package was corrupt when I tried to install another package.

    Removing the corrupt package solved this issue for me.

    You can then reinstall automapper. The issue was with version 5.4, I am now happily on 6.0.

    0 讨论(0)
  • 2020-12-07 20:01

    I had this problem in VS 2019 with an existing project using EntityFramework 6.3.0. This project had some strange version changes done to it over a period of time, and nothing would get it working. I believe I tried every suggestion listed here with no luck.

    Finally, updating to the pre-release version of EntityFramework (currently 6.4.0-preview3-19553-01) did fix the problem, by running this in the Package Manager Console: Update-Package EntityFramework -prerelease. I'm hopeful that when this version is released live in the next few weeks it will work properly.

    0 讨论(0)
  • 2020-12-07 20:02

    I had this problem in Visual Studio 2015 and resolved it by updating the version of Nuget.

    Tools -> Extensions and Updates -> Updates -> Visual Studio Gallery

    0 讨论(0)
  • 2020-12-07 20:03

    Restoring NuGet package didn'y help me. So I had to reinstall package manager - https://visualstudiogallery.msdn.microsoft.com/4ec1526c-4a8c-4a84-b702-b21a8f5293ca May be it helps someone

    0 讨论(0)
  • 2020-12-07 20:05

    I solved with uninstall and reinstall of "Microsoft.EntityFrameworkCore" and "Microsoft.EntityFrameworkCore.Tools"

    0 讨论(0)
提交回复
热议问题