Home > Asp.net MVC, Entity Framework > ‘System.Data.Objects.DataClasses.EntityObject’ is defined in an assembly that is not referenced

‘System.Data.Objects.DataClasses.EntityObject’ is defined in an assembly that is not referenced

I start a pet project using MVC3 +entity framework. When I query the entity I got the following errors.

The type ‘System.Data.Objects.DataClasses.EntityObject’ 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’

I double checked my references in my project; System.Data.Entity is in my project references. After a bit Goggling, to solve this problem you need to add the assembly reference in the web.config. See the screen shot below:


 

    

Advertisements
  1. Rajan
    December 12, 2011 at 7:33 pm

    Helpfull post

  2. May 27, 2012 at 6:07 am

    thanks dev,

    this really helps

  3. Pal
    October 16, 2013 at 10:36 pm

    Yearh! Really helpfull link.
    I still don’t understand why I should add this section to config.
    Why it isn’t enought just add reference to ‘System.Data.Entity’?

  4. West
    April 17, 2014 at 6:47 am

    Thanks! Would be great to know why this is needed though.

  1. July 29, 2014 at 2:12 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: