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

entity-framework entity-framework-core

Question

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?

Accepted Answer

Currently EF migrations are not supported out of the box:

https://github.com/aspnet/EntityFramework/issues/4497


Popular Answer

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



Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why