Creating custom Membership Provider

Discussion in 'ASP .Net Security' started by kuukoku@gmail.com, Dec 14, 2005.

  1. Guest

    I am attempting to write a custom Membership Provider, but am having a
    little trouble getting started.

    I would like to write the custom provider (either in VB or C#) as a
    standalone assembly so it can be used in multiple projects. However,
    when I create a class library project and try to write the necessary
    code, it appears that I don't have access to the required framework
    assemblies.

    When I try to inherit System.Web.Security.MembershipProvider, I get an
    error that it cannot be found. However, when I use the same code in a
    web project, it works fine.

    All code examples (including Microsoft's Sample Access Providers at
    http://msdn.microsoft.com/asp.net/downloads/providers/) seem to just
    include the code in a web project. There's got to be a way to put this
    in a class library that is reusable.
    , Dec 14, 2005
    #1
    1. Advertising

  2. Hello ,

    add a reference to system.web :)
    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > I am attempting to write a custom Membership Provider, but am having a
    > little trouble getting started.
    >
    > I would like to write the custom provider (either in VB or C#) as a
    > standalone assembly so it can be used in multiple projects. However,
    > when I create a class library project and try to write the necessary
    > code, it appears that I don't have access to the required framework
    > assemblies.
    >
    > When I try to inherit System.Web.Security.MembershipProvider, I get an
    > error that it cannot be found. However, when I use the same code in a
    > web project, it works fine.
    >
    > All code examples (including Microsoft's Sample Access Providers at
    > http://msdn.microsoft.com/asp.net/downloads/providers/) seem to just
    > include the code in a web project. There's got to be a way to put
    > this in a class library that is reusable.
    >
    Dominick Baier [DevelopMentor], Dec 15, 2005
    #2
    1. Advertising

  3. Guest

    I've done that. But when I try to inherit
    System.Web.Security.MembershipProvider, the class says that the type is
    not defined.

    To be more specific, here's the basic code:

    Imports System.Web

    Public Class CustomMembershipProvider
    Inherits System.Web.Security.MembershipProvider

    End Class

    If I put this code in a class as part of a web project, it works
    perfectly. However, if I put this code in a class library project (so
    I can re-use the assembly between projects), I get that "type is not
    defined" error.
    , Dec 15, 2005
    #3
  4. Hello ,

    did you also add a reference to the physical system.web.dll??

    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > I've done that. But when I try to inherit
    > System.Web.Security.MembershipProvider, the class says that the type
    > is not defined.
    >
    > To be more specific, here's the basic code:
    >
    > Imports System.Web
    >
    > Public Class CustomMembershipProvider
    > Inherits System.Web.Security.MembershipProvider
    > End Class
    >
    > If I put this code in a class as part of a web project, it works
    > perfectly. However, if I put this code in a class library project (so
    > I can re-use the assembly between projects), I get that "type is not
    > defined" error.
    >
    Dominick Baier [DevelopMentor], Dec 15, 2005
    #4
  5. Guest

    That did it. Thanks, I'm sorry that the resolution was so basic. For
    some reason, I didn't think about adding a reference to the DLL. (I
    also had to add a reference to System.Configuration)
    , Dec 16, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sloan
    Replies:
    5
    Views:
    1,497
    sloan
    Jun 4, 2006
  2. Replies:
    0
    Views:
    725
  3. sloan
    Replies:
    1
    Views:
    498
    Chad Scharf
    Jul 3, 2007
  4. Ryan

    Creating a Custom Membership Provider

    Ryan, Jun 26, 2006, in forum: ASP .Net Security
    Replies:
    1
    Views:
    276
    Luke Zhang [MSFT]
    Jun 27, 2006
  5. Brett Ossman

    Custom Membership Provider - Custom Error Messages

    Brett Ossman, Mar 11, 2009, in forum: ASP .Net Security
    Replies:
    0
    Views:
    782
    Brett Ossman
    Mar 11, 2009
Loading...

Share This Page