Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.


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...


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


Reinstalling the nuget package fixed this issue for me

ie, execute

Install-Package EntityFramework -Version 5.0.0

in the package manager