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.
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.
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.
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.
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.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With