This is an issue a coworker of mine ran across the other day while trying to run “Update-Database” on his EF6 project via Visual Studio 2015. Specifically, this error only seems to occur when referencing the EntityFramework NuGet package in more than one project in the same solution.
This issue appears to affect any command related to migrations, and is due to a NuGet bug in Visual Studio 2015 wherein enumerating packages will cause some packages to be returned multiple times. This only seems to affect VS2015RC, and can be fixed in one of two ways:
1st Way to Fix
- Download this patched version of EntityFramework.psm1, and copy it into the packages\EntityFramework.{version}\tools folder under the solution directory.
- Restart Visual Studio once you’ve done this.
This script isn’t signed, so you may need to unblock it in Explorer and run “Set-ExecutionPolice Unrestricted”
2nd Way to Fix
Upgrade to NuGet 3.0 RC2, which fixes the package listing duplication issue.