Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The term 'update-database' is not recognized as the name of a cmdlet, function, script file, or operable program. Check [duplicate]

Im using VS 2015 Community Update 3. When I try to recreate EF-driven database with command update-database in Package Manager Console, the error is displayed:

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.

I restarted VS a few times and reboot Windows OS, but no good results. Any help? My packages.config file is:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="EntityFramework" version="6.1.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Cors" version="5.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Identity.Core" version="2.0.1" targetFramework="net45" />
  <package id="Microsoft.AspNet.Identity.EntityFramework" version="2.0.1" targetFramework="net45" />
  <package id="Microsoft.AspNet.Identity.Owin" version="2.0.1" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi" version="5.1.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Client" version="5.1.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Core" version="5.1.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Owin" version="5.1.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.WebHost" version="5.1.2" targetFramework="net45" />
  <package id="Microsoft.Owin" version="2.1.0" targetFramework="net45" />
  <package id="Microsoft.Owin.Cors" version="2.1.0" targetFramework="net45" />
  <package id="Microsoft.Owin.Host.SystemWeb" version="2.1.0" targetFramework="net45" />
  <package id="Microsoft.Owin.Security" version="2.1.0" targetFramework="net45" />
  <package id="Microsoft.Owin.Security.Cookies" version="2.1.0" targetFramework="net45" />
  <package id="Microsoft.Owin.Security.Facebook" version="2.1.0" targetFramework="net45" />
  <package id="Microsoft.Owin.Security.Google" version="2.1.0" targetFramework="net45" />
  <package id="Microsoft.Owin.Security.OAuth" version="2.1.0" targetFramework="net45" />
  <package id="Newtonsoft.Json" version="6.0.3" targetFramework="net45" />
  <package id="Owin" version="1.0" targetFramework="net45" />
</packages>
like image 904
P.K. Avatar asked Nov 25 '16 17:11

P.K.


2 Answers

With EntityFrameworkCore I had the same problem. I found this:

Just install Microsoft.EntityFrameworkCore.Tools package from nuget:

Install-Package Microsoft.EntityFrameworkCore.Tools -Version 3.1.1

You can also use this link to install the latest version: Nuget package link

Copied from Nasir Jafarzadeh

like image 139
Tigerware Avatar answered Sep 30 '22 18:09

Tigerware


Sometimes this error occurred because of EF nuget.

Please try to reinstall or update EntityFramework nuget package.

Install-Package EntityFramework -Version 6.1.3
like image 20
Divyang Desai Avatar answered Sep 30 '22 16:09

Divyang Desai