CS0012 The type System.Data.Objects.DataClasses.EntityObject is defined in an assembly that is not referenced- MVC 4

983
Views
1
Answers

Hi,
I am building my MVC 4 application and it builds fine. when I reach a page which has to interact with Entity framework it says

CS0012: 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 have added reference to System.Data.Entity to my Web project and I can see its there. But still I could not trace the source of this error. I removed it re-added it. Checked if the version is correct but still it doesn't seem to work.
Please help!!

edit | flag
Sam Bells
Asked on: Feb 01, 2012 at 9:15AM

1 Answers

116
5
116

You should add the System.Data.Entity assembly in the web.config

Under the assembly section like..

 assemblies>
    add assembly
="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    add assembly
="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    add assembly
="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    add assembly
="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
 
/assemblies>
edit | flag
Gokul A
Answered on: Feb 01, 2012 at 9:28AM

Post your Answer

Search

Welcome to Ask Amoeba!
This is 100% free and interactive site for sharing professional Questions and Answers, Opensource projects, Interview questions.
Learners, beginners, Experts stop and share your knowledge and ideas!

Browse Categories

Browse Tags