【发布时间】:2017-10-08 15:53:45
【问题描述】:
我正在使用 .NET 框架 4.5
我已通过命令将实体框架升级到 6.1.3:-
Install-Package EntityFramework
在包管理器中
但是当我在此之后构建我的代码时,我得到了错误:-
错误 68 类型“System.Data.Objects.DataClasses.EntityObject”是 在未引用的程序集中定义。您必须添加一个 引用程序集 'System.Data.Entity, Version=4.0.0.0, 文化=中性,PublicKeyToken=b77a5c561934e089'。
在谷歌上研究了一些东西后,我在 web.config 中添加了以下代码:-
<system.web>
<compilation debug="true" targetFramework="4.5" >
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<httpRuntime targetFramework="4.5" />
</system.web>
<system.webServer>
那么我也面临同样的错误。
如何解决此错误以使用实体框架 6.1.3?
【问题讨论】:
-
您是否从这样的项目引用中添加了 System.Data.Entity? take.ms/qLOkZ
-
已经添加了
-
你的项目中不包含提到的dll文件
标签: c# asp.net .net asp.net-mvc entity-framework