.net 命名空间 system.data.entity 中不存在命名空间名称 Infrastructure
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13577157/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The namespace name Infrastructure does not exist in a namespace system.data.entity
提问by user1635479
I am getting an error message when using infrastructure namespace in system.data.entity namespace
在 system.data.entity 命名空间中使用基础架构命名空间时收到错误消息
采纳答案by Ravindra Bagale
You need to add a reference to the .NET assembly System.Data.Entity.dll.
您需要添加对 .NET 程序集的引用System.Data.Entity.dll。
回答by Gerard
You also need a reference to the EntityFramework, or you will get the same error.
您还需要对 EntityFramework 的引用,否则您将得到相同的错误。
回答by Chad Kuehn
I had a similar problem. I made a reference to System.Data.Entitybut it was complaining about System.Data.Entity.Infrastructure. The solution was to add the EntityFramework nuget. Once it's installed it actually removes the original System.Data.Entityreference and points to a new DLL that includes System.Data.Entityand System.Data.Entity.Infrastructure.
我有一个类似的问题。我提到了,System.Data.Entity但它在抱怨System.Data.Entity.Infrastructure. 解决方案是添加EntityFramework nuget。安装后,它实际上会删除原始System.Data.Entity引用并指向包含System.Data.Entity和的新 DLL System.Data.Entity.Infrastructure。

