0

I tried to update a few packages using Package Manager Console, but I am getting this:

update-package : Failed to add reference to 'EntityFramework'.
At line:1 char:1
+ update-package EntityFramework -reinstall
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Update-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.UpdatePackageCommand

Here are a few commands that I tried:

Install-Package EntityFramework
Update-Package EntityFramework -Reinstall
Update-Package -Reinstall

I also tried to update packages using UI and ran VS in administrator mode. Important to mention, the project is under TFS source control (I did make it work when I removed TFS binding). There are a few other packages - same thing with them. I see yellow exclamation next to references and I can't re-install packages.

I've never seen this error before, similar question answers don't work for me.

Luca Cappa
  • 1,925
  • 1
  • 13
  • 23
Andrei
  • 42,814
  • 35
  • 154
  • 218

2 Answers2

3

In my case packages where checked in TFS source control (which is of course terrible). This answer explains how to setup ignore rules for TFS. After deleting packages everything was fixed.

Andrei
  • 42,814
  • 35
  • 154
  • 218
0

I've tried your commands on one of my project that under VSTS source control, no issue occurred (VS 2015.3 + Package Manager Console Host Version 3.5.0.1484). You may try the items below:

  1. Check Package Manager Console version to see whether it is the latest version.

  2. Try to open the package from Manage Nuget Packages, uninstall the EntityFramework package and re-install it:

    enter image description here

  3. Enable Package restore in VS:

    enter image description here

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39