EF 6 System.Data.Objects.ObjectContext Error

前端 未结 10 673
孤独总比滥情好
孤独总比滥情好 2020-12-03 09:40

I recently upgraded from Entities Framework 5 to Entities Framework 6 Alpha 2 and I am getting the following error:

Method not found: \'System.Data.Ob

10条回答
  •  囚心锁ツ
    2020-12-03 10:33

    What worked for me was the following:

    1. Install the dll 'Microsoft.AspNet.DataSource' with:

      PM> Install-Package Microsoft.AspNet.EntityDataSource

    2. Reference 'Microsoft.AspNet.DataSource.dll' in your project.

    3. Added the following using declarations:

      using System.Data.Entity.Core.Metadata.Edm;

      using System.Data.Entity.Core.Objects;

      using Microsoft.AspNet.EntityDataSource;

    4. Removed the following using declarations:

      using System.Data.Entity;

      using System.Data.Metadata.Edm;

      using System.Data.Objects;

      using System.Web.UI.WebControls;

    Voila, code is compiling and working.

提交回复
热议问题