Error loading EntityFramework 4.3.1

有些话、适合烂在心里 提交于 2019-12-01 14:54:02

问题


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?


回答1:


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...



来源:https://stackoverflow.com/questions/9540168/error-loading-entityframework-4-3-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!