debug a custom membership and role provider?

Discussion in 'ASP .Net' started by =?Utf-8?B?QmVuIFIu?=, Mar 27, 2006.

  1. 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
     
    =?Utf-8?B?QmVuIFIu?=, Mar 27, 2006
    #1
    1. Advertising

  2. On Mon, 27 Mar 2006 08:26:01 -0800, Ben R. wrote:

    > 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.
     
    Erik Funkenbusch, Mar 27, 2006
    #2
    1. Advertising

  3. 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.
     
    Steven Cheng[MSFT], Mar 28, 2006
    #3
  4. Thanks, Steven. This helped me to solve the problem!

    -Ben

    "Steven Cheng[MSFT]" wrote:

    > 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.
    >
    >
    >
    >
     
    =?Utf-8?B?QmVuIFIu?=, Mar 29, 2006
    #4
  5. 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.
     
    Steven Cheng[MSFT], Mar 29, 2006
    #5
  6. 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



    "Ben R." wrote:

    > 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
     
    =?Utf-8?B?dWxyaWNoIHNjaHVtYWNoZXI=?=, May 17, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RedHair
    Replies:
    2
    Views:
    770
    RedHair
    Feb 21, 2006
  2. Smokey Grindle

    membership / role provider in a web service?

    Smokey Grindle, May 7, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    519
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    May 8, 2007
  3. Erich Peterson

    Membership and Role Provider Question

    Erich Peterson, Jul 2, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    376
    Cowboy \(Gregory A. Beamer\)
    Jul 2, 2007
  4. sloan
    Replies:
    1
    Views:
    514
    Chad Scharf
    Jul 3, 2007
  5. Bob Erwin

    Membership and Role Provider Discussion

    Bob Erwin, Jul 7, 2006, in forum: ASP .Net Security
    Replies:
    0
    Views:
    155
    Bob Erwin
    Jul 7, 2006
Loading...

Share This Page