加载EntityFramework 4.3.1时出错

本文关键字:1时 出错 EntityFramework 加载 | 更新日期: 2023-09-27 18:26:24

我在C#中创建了一个MVC应用程序。我在我的解决方案中创建了一个名为PhoneDomain的新项目。这样做的目的是将我的数据和域层与实际问题分开。我右键单击该项目并转到"添加库包引用",然后尝试添加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中打开了包管理器控制台,并在控制台窗口中键入以下内容: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

有人能告诉我这里发生了什么事吗?

加载EntityFramework 4.3.1时出错

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

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