I\'m using this MSDN Tutorial to run in VS2015 the command PM> Add-Migration MyFirstMigration -context BloggingContext
that ran yesterday successfully but to
What I had to do...
1) Tools -> Nuget Package Manger -> Package Manager Settings
2) General Tab
3) Clear All NuGet Cache(s)
4) Restart Visual Studio
same issue...resolved by dong the following
1.) close pm manager 2.) close Visual Studio 3.) Open Visual Studio 4.) Open pm manager
seems the trick is to close PM Manager before closing VS
In my case I added dependency via Nuget:
Microsoft.EntityFrameworkCore.Tools
And then run via Package Manager Console:
add-migration Initial -Context "ContextName" -StartupProject "EntryProject.Name" -Project "MigrationProject.Name"
Just try init Microsoft.EntityFrameworkCore.Tools. In PM execute
C:\Users\<username>\.nuget\packages\Microsoft.EntityFrameworkCore.Tools\1.0.0-preview2-final\tools\init.ps1.
It helped me with the same problem. A version of the tools might be different. It`s depended of what you use in your project.
These are the steps I followed and it solved the problem
1)Upgraded my Power shell from version 2 to 3
2)Closed the PM Console
3)Restarted Visual Studio
4)Ran the below command in PM Console dotnet restore
5)Add-Migration InitialMigration
It worked !!!
Try the following steps:
1) Open project.json
file and Remove all Microsoft.EntityFrameworkCore.Tools references from dependencies and tools sections.
2) Close Package Manager Console (PMC) and restart Visual Studio
3) Add under dependencies section:
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
}
4) Add under tools section
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
5) Restart again Visual Studio 2015
6) Open the PMC and type
Add-Migration $Your_First_Migration_Name$
This happen because the PMC recognize the tools when Visual Studio is starting.