Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Creating custom Membership Provider

Reply
Thread Tools

Creating custom Membership Provider

 
 
kuukoku@gmail.com
Guest
Posts: n/a
 
      12-14-2005
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.

 
Reply With Quote
 
 
 
 
Dominick Baier [DevelopMentor]
Guest
Posts: n/a
 
      12-15-2005
Hello http://www.velocityreviews.com/forums/(E-Mail Removed),

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



 
Reply With Quote
 
 
 
 
kuukoku@gmail.com
Guest
Posts: n/a
 
      12-15-2005
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.

 
Reply With Quote
 
Dominick Baier [DevelopMentor]
Guest
Posts: n/a
 
      12-15-2005
Hello (E-Mail Removed),

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



 
Reply With Quote
 
kuukoku@gmail.com
Guest
Posts: n/a
 
      12-16-2005
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)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Membership Provider - Custom Error Messages Brett Ossman ASP .Net Security 0 03-11-2009 09:33 PM
Membership or Role Provider // Provider Model // Factories .. How does MS do it? sloan ASP .Net 1 07-03-2007 08:17 PM
Unable to redirect when using custom 'Login' with custom 'Membership provider' asnowfall@gmail.com ASP .Net 0 06-05-2007 05:15 PM
Creating a Custom Membership Provider Ryan ASP .Net Security 1 06-27-2006 06:12 AM
Deploying 2.0 app on a Service Provider .. Membership Provider sloan ASP .Net 5 06-03-2006 11:20 PM



Advertisments