The type 'System.Data.Entity.DbContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'EntityFramework 2

后端 未结 10 660
无人共我
无人共我 2021-02-02 05:37

I\'ve got one solution - the one project is class library with .edmx data model The other is asp.net web forms project.

when i start the solution I get the following e

10条回答
  •  感情败类
    2021-02-02 06:11

    The error message is telling you that the class library with .edmx data model has the Entity Framework 5 loaded ... (obviously because there are no error messages in the .edmx) ... and your web project is referencing the class library ... so it has access to everything in the class library ... but it cannot handle the data types in the class library because your web project needs a reference to the Entity Framework 5. You will also notice that your intellisense doesn't work for the objects in your class library either.

    Simply add a reference in your web project to the entity framework 5 ... and your all set.

提交回复
热议问题