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

后端 未结 21 1502
余生分开走
余生分开走 2020-12-08 12:46

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\' 
<         


        
相关标签:
21条回答
  • 2020-12-08 13:19

    My solution was simple! I was actually having this error when checked out a repo from a svn server. I took following steps to remove error

    1. Cleaned solution
    2. Went to nuget package manager and uninstalled the entity framework.
    3. Removed DataModel and its .cs components.
    4. Shutdown the VS and opened again.
    5. Installed Entity Framework and Recreated entity model.
    6. Check if there is any files needed "Include in the solution". It worked like a charm
    0 讨论(0)
  • 2020-12-08 13:20

    I had to reference System.Data.DataSetExtensions, which seems completely illogical

    0 讨论(0)
  • 2020-12-08 13:20

    I installed EntityFramework 6.2 instead of 6.3 and it worked.

    Perhaps it is the .NetCoreApp v2.1 or .NETFramework v4.6.1.

    0 讨论(0)
  • 2020-12-08 13:20

    If you're using a database-first approach:

    Before uninstalling / reinstalling Entity Framework, first try simply adding another table / stored procedure to your model (assuming there are any currently unmapped). That fixed the issue for me. Of course if you don't need the resource mapped then just delete it from the model afterwards. But it looks like a force-regeneration of the edmx did the trick.

    0 讨论(0)
  • 2020-12-08 13:25

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

    0 讨论(0)
  • 2020-12-08 13:27

    If you are using EF version more than 6.x , then see if you have installed the entity framework nuget package in every project of your solution. You might have installed Ef but not in that particular project which you are working on.

    0 讨论(0)
提交回复
热议问题