C# 我的抽象基本成员资格提供者在哪里?
我发现C# 我的抽象基本成员资格提供者在哪里?,c#,security,namespaces,membership,membership-provider,C#,Security,Namespaces,Membership,Membership Provider,我发现MembershipProvider位于System.Web.Security命名空间中。我在我的项目中添加了一个参考System.Web,我在我的.cs文件中添加了一个using System.Web.Security指令-但正如您所见,VS2010不相信我: 找不到类型或命名空间名称“MembershipProvider” (是否缺少using指令或程序集引用?) 这里缺少什么?您需要添加对System.Web.ApplicationServices.dll的引用 这在以下文件中提到
MembershipProvider
位于System.Web.Security
命名空间中。我在我的项目中添加了一个参考System.Web
,我在我的.cs文件中添加了一个using System.Web.Security
指令-但正如您所见,VS2010不相信我:
找不到类型或命名空间名称“MembershipProvider”(是否缺少using指令或程序集引用?)
这里缺少什么?您需要添加对
System.Web.ApplicationServices.dll的引用
这在以下文件中提到:
谷歌当日搜索结果:
它在程序集中。所以,文档错误:MemebershipProvider class->assembly System.Web.dll,不是真的,我用谷歌搜索到了它,但显然没有使用正确的术语。@ScottSEA只是用谷歌搜索类名。第一个点击通常是msdn文档页面,其中包含有关包含类的程序集的信息。谢谢。我一直只关注名称空间,从未真正关注过它所在的程序集-今天学到了一些新东西。@ScottSEA:是的-程序集是需要引用的-名称空间是“using XXX.XXX”中的内容;两者都需要检查。
Namespace: System.Web.Security
Assembly: System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)