Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error loading EntityFramework 4.3.1

I created an MVC application in C#. I created a new project in my solution called PhoneDomain. The purpose of this is to separate my data and domain layer from the actual problem. I right clicked on the project and went to "Add Library Package Reference" and I attempted to add the EntityFramework package (version 4.3.1). It said "Operation Failed" "This package contains an init.ps1 file and needs to be installed from the Package Manager Console".

So I opened the Package Manager Console in Visual Studio and typed the following into the console window: install-package EntityFramework -project PhoneDomain

After a couple seconds, it installed the package and said Successfully added 'EntityFramework 4.3.1' to PhoneDomain

The problem is, when I run my application, I get the following error message: Could not load file or assembly 'EntityFramework, Version=4.3.1.0, Culture=neutral' or one of its dependencies. The system cannot find the file specified.

The reference in the PhoneDomain is definately there and the the Copy Local property is set to True.

Can anyone tell me what is going on here?

like image 440
Icemanind Avatar asked Mar 02 '12 20:03

Icemanind


1 Answers

Check your web.config for assembly references. There may be a rogue reference in there.

UPDATE: Also make sure ALL projects have the necessary reference...

like image 176
Dave Swersky Avatar answered Oct 31 '22 14:10

Dave Swersky