How to install EntityFramework 5.0 (and other older versions) from NuGet?


I installed EF 5.0 into the .DAL, now I want to install EF 5.0 into .BLL from Nuget

But the default online Nuget package always comes up with 6.0, which gives error when used together with the 5.0 EF I use in DAL.

Where can I install the 5.0 version of EntityFramework into my Nuget packages??

Accepted Answer

View -> Other windows -> Package Manager Console then run install-package entityframework -version

Add -project <> if you want to install it in a specific project.

Popular Answer

here is what I experienced: (before I begin... kudos to devnull for the answer).

I clicked on:

1) View -> Other windows -> Package Manager Console then ran

2) install-package entityframework -version

The uninstall started, but then rolled back, as it detected I already had installed Entity Framework (EF) 6.0.2 ...

>PM> install-package entityframework -version

Installing 'EntityFramework 5.0.0'. You are downloading EntityFramework from Microsoft, the license agreement to which is available at Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device. Successfully installed 'EntityFramework 5.0.0'. *****Install failed. Rolling back...***** install-package : Already referencing a newer version of 'EntityFramework'. At line:1 char:1 + install-package entityframework -version + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

So then I uninstalled the Entity Framework 6.0.2 and found it had a dependency that also needed to be removed... then I was finally able to uninstall the Entity Framework 6.0.2 and then add the Entity Framework

PM> uninstall-package entityframework -version 6.0.2 uninstall-package : Unable to uninstall 'EntityFramework 6.0.2' because 'AnotherFakeDbSet' depends on it.

So then I uninstalled these two and installed Entity Framework

PM> uninstall-package AnotherFakeDbSet -version

PM> uninstall-package entityframework -version 6.0.2

PM> install-package entityframework -version

I like the console... quicker than searching for the packages if you know the version #. And if you haven't checked out "Powershell" (the basis for the console -- I find it's time well spent - it allows for virtually unlimited automation)

Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why