无法加载我的自定义会员资格提供商?
我试图实现一个自定义会员资格提供程序,一切顺利,我可以连接,我可以更改用户详细信息,但是一旦我创建用户,当我完成创建用户后尝试获取用户时,我收到此错误。
该错误来自我的 web.config,它说这是一个 ConfigurationErrorsException,并且还说问题出在配置文件下的我的类型上,我确信我提供的提供程序类型是正确的,例如
type="MyNamespace.MyCustomMembershipProvider"
Please help me
谢谢
I was trying to implement a custom membership provider, everything goes well, I can connect, I can change user details, but as soon as I create user, I got this error when it tries to get the user after I complete create a user.
The error is coming from my web.config, it is saying it's a ConfigurationErrorsException, and it also says that the problem is on my type under the config file, I am sure that the provider type I provided is correct, such as
type="MyNamespace.MyCustomMembershipProvider"
Please help me
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您输入类型时,您需要指定它来自的程序集。
因此,
MyNamespace.dll
中的MyNamespace.MyCustomMembershipProvider
需要进行以下配置:此外,如果它抱怨默认提供程序,请将默认提供程序命名为
SqlAspNetMembershipProvider< /code> (在 XML 中,而不是类名)或在 web.config 中的“
membership
”元素上设置默认提供程序名称。这就是我的样子:
When you put the type in, you need to specify the assembly it comes from.
So
MyNamespace.MyCustomMembershipProvider
inMyNamespace.dll
, would require this configuration:Also, in case it's complaining about the default provider, either name your default provider as
SqlAspNetMembershipProvider
(in the XML, not the classname) or set the default provider name on the "membership
" element in your web.config.This is how mine looks:
如果没有看到实现,很可能您的自定义会员资格提供程序的 CreateUser 方法有问题。 点击链接了解更多信息;
http://msdn.microsoft.com/ en-us/library/system.web.security.membershipprovider.createuser.aspx
Without seeing the implementation, most likely you have a problem in your CreateUser method of your custom membership provider. Follow the link for more information;
http://msdn.microsoft.com/en-us/library/system.web.security.membershipprovider.createuser.aspx