Reputation: 1074
I am working on an project and tried know to activate the migration but when I open the Nugget package console and enter “enable-migrations myProjectName” I get the massage “The term 'Enable-Migrations' is not recognized as the name of a cmdlet”. First I thought that I have to add an extra line in my project.json under commands, so I added “"ef": "EntityFramework.Commands" but that didn’t do the trick.”
Would be grateful for any pointers.
Upvotes: 0
Views: 199
Reputation: 4592
You did mention you are using the project.json
file making me believe you are using the default ASP.NET 5 template which uses EF7 .
You can verify this by looking in your project.json
at the version number.
Mine for example is:
"EntityFramework.Commands": "7.0.0-beta8",
"EntityFramework.SqlServer": "7.0.0-beta8",
or in your Package Manager Console type in:
get-command -module entityframework
which will give you the available commands you can use. From the above you can see I am using Entity Framework 7.
Enable-Migrations
is not listed in the commands and that is the reason you are getting the error:
The term 'Enable-Migrations' is not recognized as the name of a cmdlet
If you wish to rather use EF6 instead you would have to remove those entries in your project.json
and you can add via nuget
or the package manager console EF6. Just keep in mind if you use EF6 the ASP.NET 5 Identity 3 will break as it is dependent on EF7.
The command Enable-Migrations
does not exist in Entity Framework 7
like it did in previous Entity framework versions.
In EF7 the task of creating the migrations folder is now combined with the Add-Migration
command.
See below for the Add-Migration
command differences between EF6 and EF7:
Upvotes: 2