码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-09-07 19:36:17      阅读:224      评论: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)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!