Could not locate assembly "EntityFramework"

72,264

Solution 1

Download and install Framework 4.0 and it's included.

http://www.microsoft.com/download/en/details.aspx?id=17851

Solution 2

This can also happen when you manually remove the EntityFramework reference in a project.

If you've lost the reference you can remove the entry in packages.config for EntityFramework

<packages>
    <package id="EntityFramework" version="5.0.0" targetFramework="net40" />
</packages>

After removal you are able to re-install the package through the Package Manager (Manage NuGet Packages)

Solution 3

You need to download and install Entity Framework separately:

http://blogs.msdn.com/b/adonet/archive/2011/04/11/ef-4-1-released.aspx

Solution 4

If you have not - install the Nuget extension in Visual Studio.

Using Nuget will not only enable you to have the packages with the source (in the packages directory), but will also help you keep things up to date. External dependencies you rely on should ideally be included with your solution so situations like yours do not occur.

As The Evil Greebo noted, you will need to go here to obtain the Visual Studio tooling. While the Nuget package will provide the code level support, the tooling is in the installer. I use both, so if there is an update to the package, it will show up in the Nuget update notices.

Solution 5

I resolved a similar problem myself by downloading the ASP.NET MVC Tools Update. Any chance you are just missing that on this other computer?

Share:
72,264

Related videos on Youtube

Steven
Author by

Steven

Updated on July 28, 2020

Comments

  • Steven
    Steven almost 4 years

    I've been working on this MVC 3 application on my home computer for a while now. I'm out of town on a different computer, so I got the project from my source control. This new computer didn't have MVC 3 yet, so I installed it after I copied the project to the new computer.

    A lot of my dlls (like MvcContrib.dll) were missing since I didn't set Copy Local to true when I first created the project on my home computer. So I've been going in and downloading all the missing dlls and adding them to my project.

    The only one I can't find is EntityFramework.dll. I can't find a download for it, and I don't see it as a .NET dll when I try to add a reference.

    enter image description here

    I'm getting this warning when I try to build: Could not resolve this reference. Could not locate the assembly "EntityFramework"

  • ChrisBint
    ChrisBint almost 13 years
    From the Framework 4.0 download page; The Entity Framework enables developers to program against relational databases using .NET objects and Language Integrated Query (LINQ). It is not a seperate install.
  • The Evil Greebo
    The Evil Greebo almost 13 years
    EF 4.1 is - but I did assume he wanted the latest version. :)
  • Steven
    Steven almost 13 years
    It says I already have EF 4.0 on this computer. I assume it was included in the MVC 3 Tools update. Could the issue be that I downloaded the update after I copied the MVC 3 project to this computer?
  • Steven
    Steven almost 13 years
    Nevermind, I just created a new project and it had the dll included. Then I just added a reference to it from that project.
  • bflow1
    bflow1 over 11 years
    +1. This worked for me when I opened a VS2010/EF4.1 project in VS2012, and couldn't see the EntityFramework reference, even after upgrading the solution to .NET 4.5 and installing EF5 via NuGet. I then followed Mark's advice and I now have the reference in my project.
  • d512
    d512 almost 10 years
    Thank you, this is exactly the kind of implementation detail you need to know about when Microsoft's tools get borked somehow (as they always do) and can't fix themselves.