debug a custom membership and role provider?

G

Guest

My website uses a custome membership and role provider. I can use a custom
login control and user creation control and can debug my providers while
doing so with breakpoints. However, when I launch the asp.net website config
tool and go to the security tab, I get a polished screen with the error
message:

The object refererence is not set to an instance of an object

But despite putting breakpoints everywhere in both the roleprovider and
membershipprovider, no breakpoint is hit. Any tips on how to debug this? What
code is executed when this tool is run and you go to the security tab?

-Ben
 
E

Erik Funkenbusch

The object refererence is not set to an instance of an object

You need to attach to to the Administrative Websites's process in the
debugger. Tools->Attach to process.
 
S

Steven Cheng[MSFT]

Hi Ben,

Thank you for posting.

From your description, I understand you're developing your custom ASP.NET
2.0 membership and role manage provider, when used in your application, you
can step through their source code to debug them. However, when you
launching the vs 2005 web admin page for the site and manage the security
setting, you encountered some exceptions(null reference...) and the break
point in your custom provider's source did not get hit, correct?

Based on my understanding, since the problem occured when you use the web
admin pages, I think it is likely some certain code of the web admin site
expect a certain interface or member which is not found on our custom
provider class. the Web Admin site's page and code are under the .net
framework 2.0's system folder. e.g;

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles

So if you want to do some further troubleshooting, you can have a look at
the related code(specific to the security configuration page) there. e.g if
the error occured at initialize time, you can check the initliaize and load
specific code to see what's has been called there.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Cheng[MSFT]

You're welcome Ben,

Have a nice day!

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Hi Ben,

- in VS.NET select Debug, Exceptions...,
- activate the checkbox "Thrown" of the CLR Exceptions, ok
- start the Web Site Administration Tool (WAT)
- in VS.NET select Debug, Attach to process...
- select "WebDev.WebServer.EXE", there a two, the one with the higher ID is
the right one

Now use the WAT as usually. The debugger should stop in the code line of
your custom MembershipProvider, that throws the exception. Breakpoints should
also work.

Hope this helps
ulrich
 

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,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top