I just opened VS 2012 and created a class library project. After that I added a new ADO.NET Entity Data Model item to my solution.
I noticed there are both an assembly called EntityFramework 5.0 and another one called System.Data.Entity 4.0. Shouldn’t it be just one?
As a bonus problem, when I click the file the designer crashes:
Error 2 Error 6039: warning CS1701: Assuming assembly reference 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' matches 'System.Data.Entity, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089', you may need to supply runtime policy
c:\Users\andre_pena\AppData\Local\Temp\5srvr0ge.0.cs(465,29) : error CS1061: 'System.Data.Metadata.Edm.EdmFunction' does not contain a definition for 'IsComposableAttribute' and no extension method 'IsComposableAttribute' accepting a first argument of type 'System.Data.Metadata.Edm.EdmFunction' could be found (are you missing a using directive or an assembly reference?) c:\users\andre_pena\documents\visual studio 2012\Projects\ClassLibrary2\ClassLibrary2\Model1.edmx 1 1 ClassLibrary2
Is it everything ok with my system? Is the existence of both files normal? Why am I getting this error?
You should have both assemblies:
EntityFramework.dll (has DbContext API, Code First)
System.Data.Entity.dll (has ObjectContext and DbContext APIs, new features)
The need for two assemblies are to allow the Entity Framework team to release updates without waiting for the next official release of the .NET Framework.
EdmFunction.IsComposableAttributeis supported in .NET 4.5 so check the version of yourSystem.Data.Entity.dll
And check the detailed answer here: https://stackoverflow.com/a/9694963/1241400
Tip:
If you want to use lambda with
Include()add a using directive for System.Data.Entity .