System.Web.Security.MembershipProvider在哪里?

时间:2021-08-25 16:03:00

I have a library project that should be the base for several web applications. I am trying to implement System.Web.Security.MembershipProvider but for some reason Visual Studio cannot find it. It manages to find System.Web.Security.SqlMembershipProvider but not MembershipProvider.

我有一个库项目,应该是几个Web应用程序的基础。我正在尝试实现System.Web.Security.MembershipProvider但由于某种原因Visual Studio找不到它。它设法找到System.Web.Security.SqlMembershipProvider但不是MembershipProvider。

Any idea why?

知道为什么吗?

I am using Visual Studio 2010 with .NET 4.

我正在使用Visual Studio 2010和.NET 4。

1 个解决方案

#1


36  

Starting in .NET 4, MembershipProvider is declared in System.Web.ApplicationServices.dll (strangely enough), so you need to add a reference to that assembly. In .NET 3.5 and earlier, MembershipProvider is declared in System.Web.dll.

从.NET 4开始,MembershipProvider在System.Web.ApplicationServices.dll中声明(奇怪的是),因此您需要添加对该程序集的引用。在.NET 3.5及更早版本中,MembershipProvider在System.Web.dll中声明。


Tip: To find out which assembly contains any .NET Framework class, just search for the class in MSDN Library. Here's what the MembershipProvider page for .NET 4 says:

提示:要找出哪个程序集包含任何.NET Framework类,只需在MSDN Library中搜索该类。以下是.NET 4的MembershipProvider页面所说的内容:

Namespace: System.Web.Security
Assembly: System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)

命名空间:System.Web.Security程序集:System.Web.ApplicationServices(在System.Web.ApplicationServices.dll中)

And here's what the MembershipProvider page for .NET 3.5 says:

以下是.NET 3.5的MembershipProvider页面所说的内容:

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)

命名空间:System.Web.Security程序集:System.Web(在System.Web.dll中)

#1


36  

Starting in .NET 4, MembershipProvider is declared in System.Web.ApplicationServices.dll (strangely enough), so you need to add a reference to that assembly. In .NET 3.5 and earlier, MembershipProvider is declared in System.Web.dll.

从.NET 4开始,MembershipProvider在System.Web.ApplicationServices.dll中声明(奇怪的是),因此您需要添加对该程序集的引用。在.NET 3.5及更早版本中,MembershipProvider在System.Web.dll中声明。


Tip: To find out which assembly contains any .NET Framework class, just search for the class in MSDN Library. Here's what the MembershipProvider page for .NET 4 says:

提示:要找出哪个程序集包含任何.NET Framework类,只需在MSDN Library中搜索该类。以下是.NET 4的MembershipProvider页面所说的内容:

Namespace: System.Web.Security
Assembly: System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)

命名空间:System.Web.Security程序集:System.Web.ApplicationServices(在System.Web.ApplicationServices.dll中)

And here's what the MembershipProvider page for .NET 3.5 says:

以下是.NET 3.5的MembershipProvider页面所说的内容:

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)

命名空间:System.Web.Security程序集:System.Web(在System.Web.dll中)