自定义会员资格 - 网站管理工具中出现错误(未解析会员的类型'')
我必须自定义类 MembershipProvider
才能通过电子邮件完成用户验证。
但当你打开Asp.net网站管理工具时,“安全”选项卡出现以下错误:
您选择的数据存储有问题。这可能会导致 由于服务器名称或凭据无效,或者不充分 允许。这也可能是由于角色管理器功能未启用所致 正在启用。单击下面的按钮将重定向到其中的页面 您可以选择一个新的数据存储。
以下消息可能有助于诊断问题:类型不是 为会员解决 'System.Data.Entity.ModelConfiguration.ModelValidationException,EntityFramework, 版本=4.1.0.0,文化=中性,PublicKeyToken=b77a5c561934e089'。
因为代码很棒,又不想污染主题,所以我放到了github上。
代码:
I had to customize the class MembershipProvider
for the user validation is done by email.
But when you open the Asp.net Web Site Administration Tool, the "Security" tab the following error:
There is a problem with your selected data store. This can be caused
by an invalid server name or credentials, or by insufficient
permission. It can also be caused by the role manager feature not
being enabled. Click the button below to be redirected to a page where
you can choose a new data store.The following message may help in diagnosing the problem: Type is not
resolved for member
'System.Data.Entity.ModelConfiguration.ModelValidationException,EntityFramework,
Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Because the code is great and not to pollute the topic, I put on github.
Code:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然我对 MVC 3 和 EF 4.1 还很陌生,但请尝试在 web.config 中为 EntityFramework 程序集添加一行。看来我的设置也遇到了这个问题。我不记得确切的台词了,但大概是这样的(我回家后会查一下):
While I am still new to MVC 3 and EF 4.1, try adding a line in your web.config for EntityFramework assembly. It seems like I had this problem as well with my setup. I can't remember the exact line, but it's something like (I will look it up when I get home):