Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is System.Web.Security.MembershipProvider?

Tags:

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.

Any idea why?

I am using Visual Studio 2010 with .NET 4.

like image 988
Naor Avatar asked Jun 22 '12 17:06

Naor


People also ask

What is asp net membership provider?

The ASP.NET membership provider is a feature that enables ASP.NET developers to create Web sites that allow users to create unique user name and password combinations. With this facility, any user can establish an account with the site, and sign in for exclusive access to the site and its services.

What is membership in web config?

The membership element is a sub-element of the system. web section. You can enable ASP.NET Membership for an application by directly editing the Web. config file for that application, or you can use the Web Site Administration Tool, which provides a wizard-based interface.

Which namespace contains the membership provider class?

Security namespace includes a class named MembershipUser that defines the basic attributes of a membership user and that a membership provider uses to represent individual users.

What is membership in C#?

Class members, in C#, are the members of a class that represent the data and behavior of a class. Class members are members declared in the class and all those (excluding constructors and destructors) declared in all classes in its inheritance hierarchy.


1 Answers

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.


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:

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

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

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

like image 144
Michael Liu Avatar answered Sep 20 '22 11:09

Michael Liu