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:
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 <<<< -verbose + CategoryInfo : ObjectNotFound: (Update-Database:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
I have tried to re-install EF5b1 and while was successful (already installed), the 'Update-Database' still does not work.
Can anyone help???
If the other answers don't work (VS 2017): clear the NuGet cache, restart VS, then restore the packages.
I solved with uninstall and reinstall of "Microsoft.EntityFrameworkCore" and "Microsoft.EntityFrameworkCore.Tools"
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.
Just ReOpen visual studio is work for me
Simple fix for me was to make sure there was a dash between update and database, like this:
update-database
and use lowercase. It may be coincidental, but when I did this in Packet Manager Console, the database actually updated and I got the done message rather than thenot recognized as the name of a cmdlet, function, script file
error.you will get this error when the EF tools are not installed properly.
try the below command in Nuget package manager //Uninstalls and install the same Version of EF
If you still face the same issue. create a new Web Project and run the below command in nuget.
// This will update EF to latest version(including the tools) // if you want to use specific version , use the
-version
flag.Once this is done, chcek your original project and you can delete the newly created project.