首页 文章

使用网站管理工具添加用户时的ASP.NET MembershipProvider异常

提问于
浏览
0

我已将应用程序服务数据库更改为将成员资格存储到我的网站数据库中 . 之后,当我想使用ASP.NET网站管理工具添加用户时,我收到以下异常:

调用目标抛出了异常 . 在System.RuntimeMethodHandle._InvokeMethodFast在System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo方法,对象目标(IRuntimeMethodInfo方法,对象目标,对象[]参数,SignatureStruct&SIG,MethodAttributes methodAttributes,RuntimeType typeOwner),对象[]参数,签名Sig,MethodAttributes methodAttributes System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,Binder binder,Object []参数,CultureInfo文化,布尔值skipVisibilityChecks),System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,Binder binder),RuntimeType typeOwner) System.Web.Administration.WebAdminMembershipProvider.CreateUser(String username,String password,System.Web.Administration.WebAdminMembershipProvider.CallWebAdminMembershipProviderHelperMethodOutParams(String methodName,Object [] parameters,Type [] paramTypes),System [Web参数,CultureInfo文化) String email,String passwordQuestion,String pass在System.Web.UI.WebControls的System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e)上的System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser()处的wordAnswer,Boolean isApproved,Object providerUserKey,MembershipCreateStatus&status) . System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source,EventArgs args)中的System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source,EventArgs e)中的Wizard.OnBubbleEvent(Object source,EventArgs e) System.Web.UI.Web.trol.Button.RaisePostBackEvent(String eventArgument)at System.Web.UI.Web.Controls.Button.OnCommand(CommandEventArgs e)上的System.Web.UI.Control.RaiseBubbleEvent(Object source,EventArgs args) System.Web.UI.Page.RaisePostBackEvent上的System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,String eventArgument)中的System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) (NameValueCollection中postData)在System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)

我怎样才能解决这个问题?顺便说一下,我在aspnet_user中添加了一个外键,指向我的UserProperties表 . 也许我这样做了一些东西?我可以毫无困难地添加角色!

2 回答

  • 1

    如果你有passwordFormat =“加密”,那么你必须有machineKey .

    <machineKey    validationKey= "*****YOUR_VALIDATION_KEY*****"
    decryptionKey= "*****YOUR_VALIDATION_DECRYPTIONKEY*****"
    validation="SHA1"
    decryption="AES"/>
    

    这是我生成machineKey的地方:

    http://aspnetresources.com/tools/machineKey

  • 2

    FYI

    我有完全相同的错误,结果是因为我在我的应用程序的Web配置中更改了密码检索的设置 .

    我在设置时得到了这个例外:

    enablePasswordRetrieval =“true”passwordFormat =“Encrypted”

    将这些更改回默认值解决了问题/

相关问题