MembershipProvider/RoleProvider Problems

Discussion in 'ASP .Net' started by Mark Olbert, Jan 10, 2006.

  1. Mark Olbert

    Mark Olbert Guest

    I've written a custom MembershipProvider and a custom RoleProvider, and am trying to get them to work with the ASP.NET Configuration
    tool. Which is a royal pain in the butt, because there doesn't appear to be any way to debug the Configuration tool.

    In any event, when I create a new user I get the following error message:

    An error was encountered. Please return to the previous page and try again.

    The following message may help in diagnosing the problem: Specified cast is not valid. at
    System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean isMembership, String methodName, Object[] parameters, Type[]
    paramTypes) at ASP.security_users_adduser_aspx.UpdateRoleMembership(String u, CheckBox box) in
    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles\Security\Users\addUser.aspx:line 63 at
    ASP.security_users_adduser_aspx.UpdateRoleMembership(String u) in
    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles\Security\Users\addUser.aspx:line 52 at
    ASP.security_users_adduser_aspx.CreatedUser(Object sender, EventArgs e) in
    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles\Security\Users\addUser.aspx:line 13 at
    System.Web.UI.WebControls.CreateUserWizard.OnCreatedUser(EventArgs e) at
    System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() at
    System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) at
    System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) at
    System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) at
    System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) at
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs
    e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    I'm using a SqlServer database to store the membership info, and the new user's record shows up even though this crash occurred.
    However, the assigned role was not set...which leads me to believe there's a problem with some part of the role-setting mechanism.

    Can anyone give me a clue as to how to narrow down where the problem is taking place? Is there a way to attach to the ASP.NET
    Configuration tool so I can see the exception take place? I tried attaching to its process, but that didn't work.

    - Mark
     
    Mark Olbert, Jan 10, 2006
    #1
    1. Advertisements

  2. Hi Mark,

    I've also noticed your another two threads in this newsgroup about
    developing the custom membership provider. From the call stack you provided
    there, seems you've managed to have the custom provider loaded but
    encounter some new problem during using them , yes?

    As another MVP has mentioned in your other thread, you can manually attach
    to the web admin application's process through VS IDE to debug the problem,
    you can set bread point at your provider's source code.... And I think
    you can also directly use some login controls in asp.net application's page
    to test the provider or call methods on your custom membership provider to
    test them.... e.g if the exception occur when you try add a new user or
    role, you can set bread point in the related method in your provider to
    debug them.... For web admin web app, it is hosted in the .net
    framework's build-in webserver (WebDev.WebServer.exe under the framework's
    folder....)

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)



    --------------------
    | NNTP-Posting-Date: Mon, 09 Jan 2006 23:06:22 -0600
    | From: Mark Olbert <>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | Subject: MembershipProvider/RoleProvider Problems
    | Date: Mon, 09 Jan 2006 21:06:21 -0800
    | Organization: Olbert & McHugh, LLC
    | Reply-To:
    | Message-ID: <>
    | X-Newsreader: Forte Agent 3.1/32.783
    | MIME-Version: 1.0
    | Content-Type: text/plain; charset=us-ascii
    | Content-Transfer-Encoding: 7bit
    | Lines: 35
    | X-Trace:
    sv3-jzPMsCKnDsey4ANlDZMFTxNkEk9/ZJ9OcQRrxP1IHxjvCO743eGoosJ859T7FGprcnS6rJ+8
    os/DAJ6!H9USSteOIXGAVw0SRqeRzmNVGw5CDtxMlDkpI5ckbmJdRtOBYOspX1we5ThfcythEwh5
    TA==
    | X-Complaints-To:
    | X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
    | X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
    | X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
    complaint properly
    | X-Postfilter: 1.3.32
    | Path:
    TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
    ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
    ews.com!local01.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet:369702
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | I've written a custom MembershipProvider and a custom RoleProvider, and
    am trying to get them to work with the ASP.NET Configuration
    | tool. Which is a royal pain in the butt, because there doesn't appear to
    be any way to debug the Configuration tool.
    |
    | In any event, when I create a new user I get the following error message:
    |
    | An error was encountered. Please return to the previous page and try
    again.
    |
    | The following message may help in diagnosing the problem: Specified cast
    is not valid. at
    | System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean
    isMembership, String methodName, Object[] parameters, Type[]
    | paramTypes) at
    ASP.security_users_adduser_aspx.UpdateRoleMembership(String u, CheckBox
    box) in
    |
    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles\Security\
    Users\addUser.aspx:line 63 at
    | ASP.security_users_adduser_aspx.UpdateRoleMembership(String u) in
    |
    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles\Security\
    Users\addUser.aspx:line 52 at
    | ASP.security_users_adduser_aspx.CreatedUser(Object sender, EventArgs e) in
    |
    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles\Security\
    Users\addUser.aspx:line 13 at
    | System.Web.UI.WebControls.CreateUserWizard.OnCreatedUser(EventArgs e) at
    | System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() at
    |
    System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigatio
    nEventArgs e) at
    | System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs
    e) at
    | System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source,
    EventArgs e) at
    | System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object
    source, EventArgs args) at
    | System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at
    System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs
    | e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String
    eventArgument) at
    |
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
    stBackEvent(String eventArgument) at
    | System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    sourceControl, String eventArgument) at
    | System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at
    System.Web.UI.Page.ProcessRequestMain(Boolean
    | includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    |
    | I'm using a SqlServer database to store the membership info, and the new
    user's record shows up even though this crash occurred.
    | However, the assigned role was not set...which leads me to believe
    there's a problem with some part of the role-setting mechanism.
    |
    | Can anyone give me a clue as to how to narrow down where the problem is
    taking place? Is there a way to attach to the ASP.NET
    | Configuration tool so I can see the exception take place? I tried
    attaching to its process, but that didn't work.
    |
    | - Mark
    |
     
    Steven Cheng[MSFT], Jan 10, 2006
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.