Some who try to use the Entity Framework with MVC may encounter the following error:
If you can see it the error reads:
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=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
I spent a good deal of time trying to add this reference to the View. However, for some reason despite I had the assembly in my Reference folder in the Project, it was not in the web.config. Add the following line to the web.config:
<add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
Once you add this and rebuild, the error should go away.
9 comments:
Thanks, this solved my problem.
Thankyou! fixed me too
You just saved me hours. Thanks!
Thanks!
Thanks mate, good call.
Spend hours chasing this one :( Thanx mate!
thanks..solved my problem
I love you!
coool !! thanks !!!
Post a Comment