Trouble with System.Data.Objects.DataClasses.EntityObject

Written by stevey on June 17th, 2011

I had a .net project that was initially written in C# .Net 2.0, then upgraded to 3.5, and recently to 4.0. So naturally the project have both Linq to SQL class (dbml) and Entity Framework data model class (edmx).

Then this error occurred when I was compiling a ASP.Net page that referenced a EF method call from the data layer, “Error 36 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’….”

This message actually turned out to be related to something else – System.Data.DataSetExtensions. Because after I removed the v2.0 reference to this assembly and replaced with v4.0 version, I got a different error: “The type or namespace name ‘TypedTableBase’ does not exist in the namespace ‘System.Data’ (are you missing an assembly reference?) c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET…”. I finally tracked down the culprit: there were a few auto-generated dataset classes that were added when I created some SQL server reporting service reports to the solution while I was still in .Net 2.0. To prove that, I temporarily exclude all those Reporting Services related files from the web project that is referencing the data layer, then all the compiling errors were cleared.

 

1 Comments so far ↓

  1. i tried reading your web page from my xperia x10 but it wasn’t displayed correctly.is your web page mobile supported?

Leave a Comment