加载EntityFramework 4.3.1时出错

时间:2012-03-02 20:50:23

标签: c# asp.net-mvc-3 entity-framework-4.1 ninject

我在C#中创建了一个MVC应用程序。我在我的解决方案中创建了一个名为PhoneDomain的新项目。这样做的目的是将我的数据和域层与实际问题分开。我右键单击了该项目并转到了#34;添加库包参考"我试图添加EntityFramework包(版本4.3.1)。它说" Operation Failed" " This package contains an init.ps1 file and needs to be installed from the Package Manager Console"

所以我在Visual Studio中打开了Package Manager控制台,并在控制台窗口中输入以下内容: install-package EntityFramework -project PhoneDomain

几秒钟后,它安装了软件包并说Successfully added 'EntityFramework 4.3.1' to PhoneDomain

问题是,当我运行我的应用程序时,收到以下错误消息: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.

PhoneDomain中的引用肯定在那里,Copy Local属性设置为True

谁能告诉我这里发生了什么?

1 个答案:

答案 0 :(得分:8)

检查web.config以获取程序集引用。那里可能有一个流氓参考。

更新: 还要确保所有项目都有必要的参考......