Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MembershipProvider in .NET 4.0

Tags:

How can I add the MembershipProvider class to my .NET 4.0 project in VS 2010 B2?

I want to customize a MembershipProvider, but I cannot without adding this class. Please guide me through this process.

like image 874
mSafdel Avatar asked Nov 17 '09 10:11

mSafdel


People also ask

How ASP net membership works?

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.

How do I use SQLMembershipProvider?

To configure SQLMembershipProvider, first you need to configure your database. Leave the default selection "Configure SQL Server for application services" and click Next again. Enter the server name, Select SQL Server authentication and enter user id and password as in the following figure.

Which namespace contains the membership provider class?

Web. 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.


2 Answers

Interesting. However, build errors are your friend ;)

Attempting to build a class library built as you describe, I get the following build error:

The type name 'MembershipProvider' could not be found. This type has been forwarded to assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Consider adding a reference to that assembly.

Following the instructions (adding a reference to System.Web.ApplicationServices) allows me to carry on as expected.

like image 170
Zhaph - Ben Duguid Avatar answered Oct 08 '22 17:10

Zhaph - Ben Duguid


The MembershipProvider abstract class is part of the System.Web.ApplicationServices namespace in the .net 4.0 Framework. Add a reference to that assembly and it should solve the issue.

like image 21
Manthan Avatar answered Oct 08 '22 17:10

Manthan