"EntityFramework 6.1.3" is already installed. Failed to add a link to "System.ComponentModel.DataAnnotations"

My winforms solution worked, but when I opened it again, some of the links no longer worked. So I deleted all the links in the project, including the dll links for Microsoft.

Now I am trying to add links. What should I do first?

I tried using package manager to add Entity Framework, but got an error. "EntityFramework 6.1.3" is already installed. Failed to add a link to "System.ComponentModel.DataAnnotations".

Now when I open the package manager and select On Line, the Entity Framework has a checkmark. However, when I select Installed Packages, it indicates: "No packages are installed in the current solution"

When I try to build, I get an error

Error   1   This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is E:\EShared\devnet10\SBD.Scheduling\\.nuget\NuGet.targets.  E:\EShared\devnet10\SBD.Scheduling\SBD.Scheduling.Core\SBD.Scheduling.Core.csproj   117 5   SBD.Scheduling.Core

I tried to add a link to System.ComponentModel.DataAnnotations, but it shows in links with a little yellow exclamation mark.

When I double-click the link icon in the solution editor, I get a message

The project cannot be viewed in the object browser because it is unavailable or not yet built

After using version control to return to my version with EF6.0.2, I was able to successfully install 6.0.3.

I would still like to know what went wrong.

+4
source share
2 answers
  • Close your visual studio.

  • On the Start screen, right-click on the Windows PowerShell application panel (or find it in the search bar).

  • Click Run as administrator(Very Important).

  • Run this command: Set-ExecutionPolicy Unrestricted

  • Nuget.

  • , : Set-ExecutionPolicy Restricted

+4

:

Update-Package -reinstall EntityFramework

, packages.config, :

nuget install packages.config

.

+3

All Articles