PsychoCoder
PsychoCoder

Reputation: 10755

MembershipProvider not recognized

I'm writing my own membership provider (actually just extending the built-in one) and MembershipProvider stays red with an error that it cannot be resolved, even though I've added System.Web.Security:

public sealed class MRCMembershipProvider : MembershipProvider
{
       //code here
}

Anyone got any ideas why this would be happening?

Upvotes: 0

Views: 343

Answers (2)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038730

Make sure that you have added reference to the System.Web.ApplicationServices.dll assembly which is where this class is defined as stated in the documentation:

Namespace: System.Web.Security

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

Upvotes: 2

Internet Engineer
Internet Engineer

Reputation: 2534

It works only when the namespace for the MVC application is present.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;

namespace MvcApplication6
{
    public sealed class MRCMembershipProvider : MembershipProvider
    {
    }
}

Upvotes: 0

Related Questions