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

前端 未结 3 816
梦如初夏
梦如初夏 2021-01-30 04:03

I just downloaded entity framework 6 and created a brand new project to test it. We currently use EF 5.

After adding all my tables and stored procedures, I tried to buil

相关标签:
3条回答
  • 2021-01-30 04:34

    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.

    0 讨论(0)
  • 2021-01-30 04:46

    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

    0 讨论(0)
  • 2021-01-30 04:54

    I used what "Pauly Glott", which worked for me. For a little more detailed info, see my post in Microsoft forums and the answer.

    http://social.msdn.microsoft.com/Forums/en-US/9ac881f5-18f5-4aa4-bd99-94b1fa4c37c2/why-i-am-getting-errors-like-value-of-type-systemdataobjectsobjectparameter-cannot-be?forum=adodotnetentityframework

    0 讨论(0)
提交回复
热议问题