Search code examples
c#securitynamespacesmembershipmembership-provider

Where is my abstract base MembershipProvider?


I get that the MembershipProvider is in the System.Web.Security namespace. I have added a reference System.Web in my project, I've added a using System.Web.Security directive in my .cs file - but as you can see, VS2010 does not believe me:

The type or namespace name 'MembershipProvider' could not be found
(are you missing a using directive or an assembly reference?)

I'm probably missing something here...

What am I missing here?


Solution

  • You need to add a reference to System.Web.ApplicationServices.dll.

    This is mentioned in the MembershipProvider help:

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