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 exception:
The type 'System.Data.Entity.DbContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
and when I see the references in my asp.net project I see the reference to my class and I can't see reference to entity framework. But the problem is that entity framework is installed both in my class library and web project
I suggest you to check:
Allow NuGet to download missing packages during build
ticked please refer this linkI already had the correct version of the entity framework DLL, and none of the other answers here worked for me: I had to select the EntityFramework reference in the project, then in the properties, set "Specific Version" to true.
I found this solution suitable for me.
Adding Entity Framework DLL Reference:-
Go to c:\Program Files (x86)\Microsoft ASP.NET\ASP.NETMVC 4\Packages\EntityFramework 5.0.0-rc\lib\net45
Add Entity framework DLL
Do this, it will solve the issue as it seems you have not installed Entity Framework properly or it is not working properly, Go to TOOLS > Library Package Manager > Package Manager Console in VS2012 and typed
install-package EntityFramework
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.
Add the correct reference in *.csproj file. in my cas i have added below in *.csproj file and problem solved.