8

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>
3
  • 1
    Did you try with update EntityFramework nuget ? Commented Nov 25, 2016 at 17:56
  • Yes, it worked:) Strange:)
    – P.K.
    Commented Nov 25, 2016 at 18:02
  • 1
    Tyrone's answer worked for me; stackoverflow.com/a/46018504/1327316 Please check it out.
    – Erdogan
    Commented Mar 27, 2019 at 18:53

3 Answers 3

19

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

0
2

Sometimes this error occurred because of EF nuget.

Please try to reinstall or update EntityFramework nuget package.

Install-Package EntityFramework -Version 6.1.3
-1

I solved by updateing Package Manager Console. My EF was updated.

I was not getting Update-Database in Package Manager Console. Then i restart several time. Also restart Windows.

Then I download new one from nuget and then it was solved.

1
  • 1
    what command did you use to update Package Manager Console? Commented Aug 19, 2020 at 16:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.