형식 또는 네임 스페이스 이름 'Entity'가 네임 스페이스 'System.Data'에 없습니다.
WS 클래스를 사용하고 있는데 응용 프로그램을 실행할 때 오류가 발생했습니다.
The type or namespace name 'Entity' does not exist in the namespace 'System.Data'
System.Data;및에 대한 참조 가 System.Data.Entity;있지만 변경 사항은 없습니다. 계속 오류가 발생합니다. web.config에도 다음 줄이 있습니다.
<compilation debug ="true" targetFramework="4.0"/>
Visual Studio 솔루션 탐색기에서 솔루션을 마우스 오른쪽 단추로 클릭하고 솔루션에 대한 Nuget 패키지 관리를 클릭하고 EntityFramework를 설치합니다.
안녕하세요,이 게시물을 2 년 동안 읽으면 매우 오해의 소지가 있습니다.
VS 2013에서 EF6 및 .net 4.5.1을 사용하여이 작업을 수행하려면 다음을 참조해야했습니다.
using System.Data.Entity.Core.EntityClient;
이전과는 조금 다르지만
이것은 원래 질문에 대한 답변보다 새로운 문제에 대한 도움을 위해 여기에 오는 사람들을위한 FYI에 가깝습니다.
감사합니다 여러분! 해결책을 찾았습니다. 왜 그런지 이해하지 못했지만 이것을 시도했고 효과가있었습니다! 다음에 대한 참조를 추가 System.Data.Entity.Design해야 using했고 코드에 아무것도 작성할 필요가 없습니다 . 감사!
엔터티 프레임 워크 6.1.3이 있었고 업그레이드 (NuGet에서 더 많이 다운 그레이드 됨)가 6.1.2로 업그레이드되었습니다. 일했다.
VS 솔루션을 마우스 오른쪽 단추로 클릭하고 NuGet 패키지 솔루션 관리를 클릭하고 Entity Framework를 검색하여 Entity 프레임 워크를 설치해야합니다. 설치 후 문제가 해결됩니다.
Visual Studio 2013 및 EF6에서 동일한 오류가 발생했습니다. NewGet 패키지 Entity Framework를 사용해야하고 작업을 완벽하게 수행했습니다.
모든 경우에 대한 답변을 추가하겠습니다.
내 솔루션은 NuGet 패키지 관리자에서 EntityFramework를 제거하고 "제거를 완료"할 수 없기 때문에 Visual Studio를 다시 시작하라는 메시지가 표시되었습니다.
Visual Studio를 다시 시작하고 EntityFramework를 다시 설치하면 문제가 해결되었습니다.
이것이 누군가를 돕기를 바랍니다!
내 솔루션은 간단했습니다! 실제로 svn 서버에서 저장소를 체크 아웃했을 때이 오류가 발생했습니다. 오류를 제거하기 위해 다음 단계를 수행했습니다.
- 세정액
- 패키지 관리자를 nuget하고 엔티티 프레임 워크를 제거했습니다.
- DataModel 및 해당 .cs 구성 요소를 제거했습니다.
- VS를 종료하고 다시 열었습니다.
- Entity Framework를 설치하고 엔터티 모델을 다시 생성했습니다.
- "솔루션에 포함"이 필요한 파일이 있는지 확인하십시오. 매력처럼 작동 했어
다시 설치 시도-운이 없습니다. 엔티티를 찾기 전에 모델의 테이블을 새로 고쳐야했습니다.
도움이되었고 EF를 제거하고 VS를 다시 시작하고 '사용'을 추가했습니다.
using System.Data.Entity;
using System.Data.Entity.Core.Objects;
using System.Data.Entity.Infrastructure;
DBModel을 새로 고쳐야했습니다. 그것은 그것을 해결했습니다
완전히 비논리적으로 보이는 System.Data.DataSetExtensions를 참조해야했습니다.
프로젝트에 EntityFramework Nuget 패키지가 설치되어 있는지 확인하십시오.
@TonyDing의 답변에서 :
Visual Studio 솔루션 탐색기에서 솔루션을 마우스 오른쪽 단추로 클릭하고 솔루션에 대한 Nuget 패키지 관리를 클릭하고 EntityFramework를 설치합니다.
설치되면 여전히 오류가 발생했지만 @papergodzilla의 의견에 따라 다시 설치했습니다.
업데이트 패키지-재설치
그리고 그것은 내 문제를 해결했습니다.
패키지 관리자 콘솔에서이 작업을 수행하십시오 (보기> 기타 창> 패키지 관리자 콘솔).
이제 모든 것이 좋습니다!
나는 같은 오류가 있었다.
Nuget Packages에서 System.Data.Entity.Repository를 추가했는데 오류가 사라집니다.
도움이 되길 바랍니다!
csproj에서 프레임 워크 엔터티에 다음과 같은 힌트 경로가 있음을 알았습니다.
<HintPath>..\..\..\..\..\..\Users\{myusername}
nuget.config 파일에 다음이 있습니다.
<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.
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.
I found the root cause is when you install the nuget packages through the UI the scripts won't run sometimes. So I'd recommend open Output view while you do that. If you don't see the license agreement window when installing Nuget, there is a better change your IDE isn't doing the job right. So that's why a restart, cleanup and rebuild helps!
PS: That adding anything under System.Data.Entity.* helps because, that triggers the Nuget installer to work properly. But this I found a quite unreliable way.
So just watch the output window, you MUST see something like a successful nuget installation message at the end. Most the time when there an issue, Nuget installer won't even kick off. That's when your restart of IDE is going to help.
When things go well, Nuget package manager and IDE (I used Installer term above) would do the change, compile the solution and keep you happy! But when its not give a little help by restarting IDE and watching that Output window!
I had just updated my Entity framework to version 6 in my Visual studio 2013 through NugetPackage and add following References:
System.Data.Entity,
System.Data.Entity.Design,
System.Data.Linq
by right clicking on references->Add references in my project. Now delete my previously created Entity model and recreate it again,Built solution. Now It works fine for me.
Reinstalling the EntityFramework worked to me too. Reinstall it, rebuild it.
'Nice programing' 카테고리의 다른 글
| C #의 내부 봉인 클래스 란 무엇입니까? (0) | 2020.11.19 |
|---|---|
| Rails 모듈에서 URL 도우미에 액세스하는 방법 (0) | 2020.11.19 |
| 정규식 범위의 이스케이프 점 (0) | 2020.11.19 |
| Express Passport (node.js) 오류 처리 (0) | 2020.11.19 |
| 사전에서 숫자 값 증가 (0) | 2020.11.19 |