I\'m using this MSDN Tutorial to run in VS2015 the command PM> Add-Migration MyFirstMigration -context BloggingContext
that ran yesterday successfully but to
I had this problem and none of the previous solutions helped me. My problem was actually due to an outdated version of powershell on my Windows 7 machine - once I updated to powershell 5 it started working.
I just had this problem too. I closed and opened VS2015 and it "fixed" the issue...
I ran into the same issue. Most of my projects had the same thing in tools.
"tools": {
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
}
This worked fine on all but one project. I changed the entry in tools to
"tools": {
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
}
}
And then ran dotnet restore
. After the restore completed, Add-Migration
worked normally.
It's so simple.
Just install Microsoft.EntityFrameworkCore.Tools
package from nuget:
Install-Package Microsoft.EntityFrameworkCore.Tools -Version 3.1.5
You can also use this link to install the latest version: Nuget package link
.NET CLI command:
dotnet add package Microsoft.EntityFrameworkCore.Tools
I tried doing all the above and no luck. I downloaded the latest .net core 2.0 package and ran the commands again and it worked.
Go to package manager console(in visual studio) and execute below command
C:\Users\<YOUR_USER>\.nuget\packages\Microsoft.EntityFrameworkCore.Tools\<YOUR_INSTALLED_VERSION>\tools\init.ps1