无法加载我的自定义会员资格提供商?

发布于 2024-07-15 06:39:23 字数 295 浏览 5 评论 0原文

我试图实现一个自定义会员资格提供程序,一切顺利,我可以连接,我可以更改用户详细信息,但是一旦我创建用户,当我完成创建用户后尝试获取用户时,我收到此错误。

该错误来自我的 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 技术交流群。

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

发布评论

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

评论(2

神仙妹妹 2024-07-22 06:39:23

当您输入类型时,您需要指定它来自的程序集。

因此,MyNamespace.dll 中的 MyNamespace.MyCustomMembershipProvider 需要进行以下配置:

type="MyNamespace.MyCustomMembershipProvider, MyNamespace"

此外,如果它抱怨默认提供程序,请将默认提供程序命名为 SqlAspNetMembershipProvider< /code> (在 XML 中,而不是类名)或在 web.config 中的“membership”元素上设置默认提供程序名称。

这就是我的样子:

<membership defaultProvider="SqlMembershipProvider">
    <providers>
        <clear/>
        <add name="SqlMembershipProvider" 
             type="Barnwell.Web.Security.SqlMembershipProvider, Barnwell.Web.Security" 
        ... />

When you put the type in, you need to specify the assembly it comes from.

So MyNamespace.MyCustomMembershipProvider in MyNamespace.dll, would require this configuration:

type="MyNamespace.MyCustomMembershipProvider, MyNamespace"

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:

<membership defaultProvider="SqlMembershipProvider">
    <providers>
        <clear/>
        <add name="SqlMembershipProvider" 
             type="Barnwell.Web.Security.SqlMembershipProvider, Barnwell.Web.Security" 
        ... />
玉环 2024-07-22 06:39:23

如果没有看到实现,很可能您的自定义会员资格提供程序的 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

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