PC Review


Reply
Thread Tools Rate Thread

Custom Membership Provider: 'Could not load type' Error

 
 
Kirk
Guest
Posts: n/a
 
      6th Feb 2007
I followed the procedure at this site (http://www.devx.com/asp/Article/
29256/0/page/1) to create a custom membership provider on a ASP.NET
Web Site. However, when I try this same method on a ASP.NET Web
Application (WAP), I get a "Could not load type MyMembershipProvider"
error. My web.config file looks like this:

<membership defaultProvider="MyMembershipProvider" >
<providers>
<add name="MyMembershipProvider"
type="MyMembershipProvider"
requiresQuestionAndAnswer="true"
connectionString="Data Source=TAL-LT-KARLR;Initial
Catalog=WebReports;Integrated Security=True"/>
</providers>

And the start of my class looks like this:

Public Class MyMembershipProvider
Inherits MembershipProvider

Public Overrides Property ApplicationName() As String
Etc....

Do I have to create some specific folder for my
MyMembershipProvider.VB file to reside? Or do I need to add some
specific reference within the project?
I would greatly appreciate any suggestions or comments anyone could
give me. Thank you!

 
Reply With Quote
 
 
 
 
Kirk
Guest
Posts: n/a
 
      6th Feb 2007
On Feb 6, 2:39 pm, "Kirk" <lok...@hotmail.com> wrote:
> I followed the procedure at this site (http://www.devx.com/asp/Article/
> 29256/0/page/1) to create a custom membership provider on a ASP.NET
> Web Site. However, when I try this same method on a ASP.NET Web
> Application (WAP), I get a "Could not load type MyMembershipProvider"
> error. My web.config file looks like this:
>
> <membership defaultProvider="MyMembershipProvider" >
> <providers>
> <add name="MyMembershipProvider"
> type="MyMembershipProvider"
> requiresQuestionAndAnswer="true"
> connectionString="Data Source=TAL-LT-KARLR;Initial
> Catalog=WebReports;Integrated Security=True"/>
> </providers>
>
> And the start of my class looks like this:
>
> Public Class MyMembershipProvider
> Inherits MembershipProvider
>
> Public Overrides Property ApplicationName() As String
> Etc....
>
> Do I have to create some specific folder for my
> MyMembershipProvider.VB file to reside? Or do I need to add some
> specific reference within the project?
> I would greatly appreciate any suggestions or comments anyone could
> give me. Thank you!


Just wanted to post the solution to my own question in case someone
ran accross this later.

I read this obscure MSDN article, which states "In order to use the
sample provider, you can place your source code in the App_Code
directory of your application."
http://msdn2.microsoft.com/en-us/library/44w5aswa.aspx


So I created a folder called "App_Code", and placed my
MyMembershipProvider.VB file in it and VOILA! A working WAP CMP.
(Well, technically not VOILA, as this took me some time to find).
Maybe this is common knowledge to other developers, but this was
extremely frustrating for me. No other post, article or sample
explained this "minor" detail. Sigh.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Unable to redirect when using custom 'Login' with custom 'Membership provider' asnowfall@gmail.com Microsoft ASP .NET 0 5th Jun 2007 06:15 PM
Custom Role Provider give "can't load type error" Alias Microsoft ASP .NET 5 18th Feb 2007 11:09 PM
Custom Membership Provider =?Utf-8?B?Um9u?= Microsoft C# .NET 4 6th Jul 2006 05:38 PM
custom membership provider =?Utf-8?B?QXhmb3Jk?= Microsoft ASP .NET 1 19th Apr 2006 11:00 PM
Custom Membership Provider ats@jbex Microsoft VB .NET 0 16th Jan 2006 02:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:29 AM.