使用网站管理工具添加用户时出现 ASP.NET MembershipProvider 异常
我已更改我的应用程序服务数据库以将会员资格信息存储到我的网站数据库中。 之后,当我想使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您有passwordFormat =“Encrypted”,那么您必须有machineKey。
这是我生成 machineKey 的地方:
http://aspnetresources.com/tools/machineKey
If you have passwordFormat="Encrypted" then you MUST have machineKey.
This is where I generated my machineKey:
http://aspnetresources.com/tools/machineKey
仅供参考,
我遇到了完全相同的错误,结果是因为我更改了应用程序的 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/