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\'
<
Most of the answers here seem to lack awareness of the namespace change that happened between EF 6.2 and 6.3.
I was intentionally upgrading from EF 6.1 to 6.3 to be able to target .NET Standard 2.1. However, I accidentally used .NET Standard 2.0 for the new target in my lib and then got the The type or namespace name 'Entity' does not exist in the namespace 'System.Data'
. This GH issue comment gave me the clue I needed to fix. I changed my lib target to .NET Standard 2.1 and the project compiled. No re-installs, uninstalls, or restarts were required.
You need to install Entity framework by right click on your VS solution and click Manage NuGet Package solution and search there Entity framework. After installation the issue will be solved
Make sure you have the EntityFramework Nuget package installed for your project.
From @TonyDing's answer:
Right-click on the Solution from the Visual Studio Solution Explorer click the Manage Nuget packages for solution and install the EntityFramework
Once it is installed, I still had the error, but then did a reinstall per @papergodzilla's comment:
Update-Package -reinstall
and it resolved my issue
Do this in the Package Manager Console (View > Other windows > Package Manager Console).
Now everything is good!
I had to refresh my DBModel. That solved it
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
I noticed that in the csproj the framework entity had hintpath like
<HintPath>..\..\..\..\..\..\Users\{myusername}
I had this in the nuget.config file:
<config>
<add key="repositoryPath" value="../lib" />
</config>
a) I removed the above lines, b) uninstalled the framework entity package, c) THEN CLOSED THE solution and reopened it, d) reinstalled the framework.
It fixed my issue.