Entity Framework 6 Cannot build after adding stored procedures to data model

对着背影说爱祢 提交于 2019-12-02 14:22:51

I guess you are using EF tools from VS2012 which are still bound to original EF distribution (part of .NET framework). EF6 uses out-of-band distribution and it doesn't work with previous tooling - that is the reason why those types has little bit different namespaces and cannot be converted from one to another.

Solution should be downloading and installing EF6 tools for VS2012 or using VS2013 where tools should be included.

You can overcome this scenario by replacing:

using System.Data.Objects;

With:

using System.Data.Entity.Core.Objects;

You may need to update the using statements in your T4 templates, like your Context.tt file, so that auto-generated files continue to work when re-generating.

Before

After

user3154031
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!