Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type or namespace name 'Entity' does not exist in the namespace 'System.Data'

I'm using WS class and it gave me error when I run the application:

The type or namespace name 'Entity' does not exist in the namespace 'System.Data' 

I have a reference to the System.Data; and to System.Data.Entity; But no changes. I keep getting the error. I have also in the web.config the line:

<compilation debug ="true" targetFramework="4.0"/>
like image 676
st mnmn Avatar asked Apr 02 '12 07:04

st mnmn


4 Answers

Right-click on the Solution from the Visual Studio Solution Explorer click the Manage Nuget packages for solution and install the EntityFramework

like image 68
Tony Ding Avatar answered Nov 03 '22 05:11

Tony Ding


Hi this post is very misleading, if your reading this 2 years on.

With using EF6 and .net 4.5.1 in VS 2013 I have had to reference the following to get this to work

using System.Data.Entity.Core.EntityClient;

a little different to before,

this is more of a FYI for people that come here for help on newer problems than a answer to the original question

like image 36
AlanMorton2.0 Avatar answered Nov 03 '22 07:11

AlanMorton2.0


Thanks every body! I found the solution. not that I understand why but I tried this and it worked! I just had to add a reference to: System.Data.Entity.Design and don't have to write any using in the code. Thanks!

like image 28
st mnmn Avatar answered Nov 03 '22 05:11

st mnmn


I had entity framework 6.1.3, upgraded (well, more downgraded in NuGet) to 6.1.2. Worked.

like image 10
TJPrgmr Avatar answered Nov 03 '22 06:11

TJPrgmr