5

I am pretty new to EF and have tried to install entityframework from the Package Manager console. But I get this error:

PM> install-package entityframework
install-package : Unable to find package 'entityframework'.
At line:1 char:1
+ install-package entityframework
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

Not sure why I am getting this error.

This is my settings for Package Source;

enter image description here

Is the Package Source setup correctly, if it is, what is the issue with installing EF?

Please advise.

5
  • Can you install other packages? Also, can you install anything via the Manage NuGet packages... window (just right click on the project in Solution Explorer)? Commented Mar 16, 2016 at 20:26
  • Do you have the name of some test package I should try? Commented Mar 16, 2016 at 20:27
  • Doesn't matter, try NewtonSoft.Json. Just to see if the issue is with EF only or with the connection to NuGet in general. Commented Mar 16, 2016 at 20:29
  • Yes, I can install json Commented Mar 16, 2016 at 20:30
  • @user1205746, Make sure your internet connection is ok. Commented Feb 7, 2022 at 10:26

3 Answers 3

18

Try updating your NuGet package Manager (via Tools -> Extensions and updates and then add a new feed with https://api.nuget.org/v3/index.json as source.

UPDATE

NuGet Package Manager
Go to Tools -> Extensions and updates, in the popup, select the Updates -> Visual Studio Gallery submenu. Check if NuGet is listed there. If so, update it.

Adding a new NuGet feed
Go to Tools -> Options -> NuGet Package Manager -> Package sources. Click on the green plus icon to add a new source. You can enter any name you want (e.g. nuget.org) and enter https://api.nuget.org/v3/index.json as source.

After this is done, in Package Manager Console, you'll see the newly created entry in the dropdown Package source.

Sign up to request clarification or add additional context in comments.

3 Comments

I apologize for my ignorance. Could you please elaborate what you meant by adding a new feed? Replacing the existing Package Sources with the url you mentioned above? I went in extensions and updates, and was told Nuget Package Manager already existed, I only have the option to remove it.
See me comment with the extended description.
Thanks Szeki. Adding the new feed in Tools->Option works! Thanks!
2

Check what Package source is selected in the Package source list enter image description here

make sure that nuget.org is selected

Comments

0

Simply restarting Visual Studio worked for me (for some reason).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.