I tried to run the command \'Enable-Migrations\' in a new project and I got the message:
PM> Enable-Migrations
The term \'Enable-Migrations\' is not recog
I reinstalled with the commmand: Install-Package EntityFramework -IncludePrerelease and the problem went away.
None of these solutions worked for me. My solution was to delete packages/EntityFramework.6.1.3
and Restore NuGet Packages
I noticed that packages/EntityFramework.6.1.3/tools/EntityFramework.psd1
was missing, so this was a likely cause. How it got removed in the first place though I have no clue.
Restarting Visual Studio with administrator privilege solved the issue for me.
In .NET Core, I was able to reach the same resolution as described in the accepted answer, by entering the following in package manager console:
Install-Package EntityFramework.Core -Pre
downgrade to 6.2 helped me.
.NET Framework version 4.6.1
Project in old format(non .NET Standard)
Visual Studio should be open with Admin rights for initial migration.
I guess EF with version above 6.2 require latest .NET Framework.
I had multiple projects in the solution, but I had the correct Default Project set, so I thought it should work.
In the end, I had to add the -StartupProject MyProjectName
option to the command