Custom Membership Provider: 'Could not load type' Error

K

Kirk

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!
 
K

Kirk

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top