The type 'System.Data.Objects.ObjectContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'


You receive this error because you have not used references in your project to use System.Data.Entity namespaces.

To including the Entity Framework in your application, you must have a reference to the System.Data.Entity namespace so that you have access to the core functionality of the Entity Framework. These classes enable you to query, insert, update, and delete data.

1. In Solution Explorer, right-click References and select Add Reference from the right-click menu.
2. The Reference Manager dialog box is displayed.
3. Select System.Data.Entity from the list in the dialog box and Click OK.

Comments