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:
If you use Entity Framework:
Error Message: "Error Message (from the Update-Database command in the PMC): 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."
Solution: Exit Visual Studio. Reopen project and try again.
For more information please visit: Advanced Entity Framework 6 Scenarios for an MVC 5 Web Application (12 of 12)
Hope this helps...
In my case, I did the following:
- restored missing NuGet packages by clicking "Restore" button on top of the Package Manager Console
- restarted Visual Studio
- run update-database
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 the not recognized as the name of a cmdlet, function, script file
error.
I had this same problem, and the origin of it was on my path name, I had on my path a directory name with straight brackets, like this: C:\[PROJ]\TestApp
.
When I removed the brackets, to C:\PROJ\TestApp
, it started to work just fine...
Reinstalling the nuget package fixed this issue for me
ie, execute
Install-Package EntityFramework -Version 5.0.0
in the package manager
For anyone who is using .Net Core and EntityFrameworkCore:
You will need to install Microsoft.EntityFrameworkCore.Tools
package to resolve this issue.
Read more here: https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/powershell