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

18,116

Solution 1

Sometimes this error occurred because of EF nuget.

Please try to reinstall or update EntityFramework nuget package.

Install-Package EntityFramework -Version 6.1.3

Solution 2

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

Share:
18,116
P.K.
Author by

P.K.

Im software develeoper in one of Polish outsourcing companies. My main domain is c# and related topics (ASP.NET, web API etc.)

Updated on June 12, 2022

Comments

  • P.K.
    P.K. almost 2 years

    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>
    
  • Geoff Langenderfer
    Geoff Langenderfer over 3 years
    what command did you use to update Package Manager Console?