Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Security (http://www.velocityreviews.com/forums/f62-asp-net-security.html)
-   -   Creating custom Membership Provider (http://www.velocityreviews.com/forums/t768092-creating-custom-membership-provider.html)

kuukoku@gmail.com 12-14-2005 04:18 PM

Creating custom Membership Provider
 
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] 12-15-2005 05:22 PM

Re: Creating custom Membership Provider
 
Hello kuukoku@gmail.com,

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




kuukoku@gmail.com 12-15-2005 05:53 PM

Re: Creating custom Membership Provider
 
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] 12-15-2005 06:50 PM

Re: Creating custom Membership Provider
 
Hello kuukoku@gmail.com,

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




kuukoku@gmail.com 12-16-2005 03:17 PM

Re: Creating custom Membership Provider
 
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)



All times are GMT. The time now is 02:05 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.