Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EF7: The term 'add-migration' is not recognized as the name of a cmdlet

I have framework version set to: dnx46 in project.json. Also have the following packages:

  "dependencies": {
    "EntityFramework.Commands": "7.0.0-rc1-final",
    "EntityFramework.Core": "7.0.0-rc1-final",
    "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
    "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final"
  }

However when I got into running enable-migrations command I get the following:

The term 'enable-migrations' is not recognized as the name of a cmdlet

Does anyone know how I get EF migrations running in latest .NET?

like image 356
user183872 Avatar asked Feb 01 '16 21:02

user183872


1 Answers

This is what worked for me to solve this issue:

Run:

Install-Package Microsoft.EntityFrameworkCore.Tools –Pre

In project.json add this (if not there already) to the "tools" section:

"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview4-final",

Useful reference: https://docs.efproject.net/en/latest/platforms/aspnetcore/new-db.html

like image 160
Elijah Lofgren Avatar answered Oct 20 '22 00:10

Elijah Lofgren