【发布时间】:2017-11-23 21:52:57
【问题描述】:
在控制台应用程序中获取error:
类型“System.Data.Objects.ObjectResult`1”在未引用的程序集中定义。您必须添加对程序集 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'的引用
但不知道如何在 app.config 中为这个程序集添加引用?
我尝试添加为:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Data.Entity" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
但这不起作用。如何解决?
【问题讨论】:
-
这是绑定重定向,而不是引用。
-
@CodeCaster,那我怎样才能摆脱这个错误呢?
-
通过添加参考资料,该参考资料已在网络上完整记录。
标签: c# asp.net-mvc console-application