首页 > 其他 > 详细

Entity Framwork 6 编译出错的问题(VS2012)

时间:2015-09-07 19:33:26      阅读:1586      评论:0      收藏:0      [点我收藏+]

在VS2012中使用EF6上来建立一个Entity Data Model后啥都不干,编译都会报错。

错误如下:

Value of type ‘System.Data.Objects.ObjectParameter‘ cannot be converted to ‘System.Data.Entity.Core.Objects.ObjectParameter‘.

Value of type ‘System.Data.Entity.Core.Objects.ObjectResult(Of DataLibrary.MyStoredProc_Result)‘ cannot be converted to ‘System.Data.Objects.ObjectResult(Of DataLibrary.MyStoredProc_Result)‘

Google一搜有很多,最符合的在这里:http://stackoverflow.com/questions/19661494/entity-framework-6-cannot-build-after-adding-stored-procedures-to-data-model

解决方法:

法一:回退到EF5

法二:将*.Context.tt文件中的

using System.Data.Objects;
using System.Data.Objects.DataClasses;

替换为

using System.Data.Entity.Core.Objects;
using System.Data.Entity.Core.Objects.DataClasses;

原因就是名称空间冲突了。

Entity Framwork 6 编译出错的问题(VS2012)

原文:http://www.cnblogs.com/lx-nju/p/4789719.html

(0)
(2)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!