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

发布于 2024-12-29 04:18:52 字数 2113 浏览 1 评论 0原文

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

调用目标已引发异常。在 System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo 方法、对象目标、Object[] 参数、SignatureStruct&签名, MethodAttributes methodAttributes、RuntimeType typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo方法, 对象目标、Object[] 参数、签名 sig、MethodAttributes methodAttributes、RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(对象 obj,BindingFlags invokeAttr、Binder 绑定器、Object[] 参数、CultureInfo 文化、 布尔值skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(对象 obj,BindingFlags invokeAttr、Binder 绑定器、Object[] 参数、CultureInfo 文化) 在 System.Web.Administration.WebAdminMembershipProvider.CallWebAdminMembershipProviderHelperMethodOutParams(字符串 方法名称、对象[] 参数、类型[] paramTypes) at System.Web.Administration.WebAdminMembershipProvider.CreateUser(字符串 用户名,字符串密码,字符串电子邮件,字符串密码问题, 字符串passwordAnswer,布尔值isApproved,对象providerUserKey, 会员创建状态&状态)在 System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() 在 System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) 在 System.Web.UI.WebControls.Wizard.OnBubbleEvent(对象源, 事件参数 e) at System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(对象 来源,EventArgs e) at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(对象 来源,EventArgs args)位于 System.Web.UI.Control.RaiseBubbleEvent(对象源,EventArgs args) 在 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) 处 System.Web.UI.WebControls.Button.RaisePostBackEvent(字符串 事件参数) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String 事件参数) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler) 源控件,字符串事件参数)位于 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) 在 System.Web.UI.Page.ProcessRequestMain(布尔值 includeStagesBeforeAsyncPoint、布尔值 includeStagesAfterAsyncPoint)

如何解决此问题? 顺便说一下,我在 aspnet_user 中添加了一个外键来指向我的 UserProperties 表。 也许我这样做破坏了一些东西? 而且我可以毫无困难地添加角色!

I have changed my Application Services Database to store membership things into my web site database.
After that, when I want to add User with the ASP.NET Web Site Administration Tool, I get the following exception:

Exception has been thrown by the target of an invocation. at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo
method, Object target, Object[] arguments, SignatureStruct& sig,
MethodAttributes methodAttributes, RuntimeType typeOwner) at
System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method,
Object target, Object[] arguments, Signature sig, MethodAttributes
methodAttributes, RuntimeType typeOwner) at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture,
Boolean skipVisibilityChecks) at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at
System.Web.Administration.WebAdminMembershipProvider.CallWebAdminMembershipProviderHelperMethodOutParams(String
methodName, Object[] parameters, Type[] paramTypes) at
System.Web.Administration.WebAdminMembershipProvider.CreateUser(String
username, String password, String email, String passwordQuestion,
String passwordAnswer, Boolean isApproved, Object providerUserKey,
MembershipCreateStatus& status) 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)

How can I fix this?
By the way, I've added a foreign key in my aspnet_user to point to my UserProperties Table.
Maybe I broke something by doing this?
And I can add roles without any trouble!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风轻花落早 2025-01-05 04:18:52

如果您有passwordFormat =“Encrypted”,那么您必须有machineKey。

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

这是我生成 machineKey 的地方:

http://aspnetresources.com/tools/machineKey

If you have passwordFormat="Encrypted" then you MUST have machineKey.

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

This is where I generated my machineKey:

http://aspnetresources.com/tools/machineKey

一袭白衣梦中忆 2025-01-05 04:18:52

仅供参考,

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

当设置为:

enablePasswordRetrieval =“true” 时,我遇到了此异常
passwordFormat="Encrypted"

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

FYI

I had the exact same error, and it turned out to be because I changed setting for password retrieval in the web config of my app.

I got this exception while settings were :

enablePasswordRetrieval="true"
passwordFormat="Encrypted"

Changing these back to default solved the problem/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文