.NET 4.0 中的 MembershipProvider
如何将 MembershipProvider 类添加到 VS 2010 B2 中的 .NET 4.0 项目中?
我想自定义一个 MembershipProvider,但是如果不添加这个类我就不能。请指导我完成这个过程。
How can I add the MembershipProvider class to my .NET 4.0 project in VS 2010 B2?
I want to customize a MembershipProvider, but I cannot without adding this class. Please guide me through this process.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
有趣的。但是,构建错误是您的朋友;)
尝试构建按照您描述的方式构建的类库,我收到以下构建错误:
遵循说明(添加对 System.Web.ApplicationServices 的引用)使我能够按预期进行。
Interesting. However, build errors are your friend ;)
Attempting to build a class library built as you describe, I get the following build error:
Following the instructions (adding a reference to System.Web.ApplicationServices) allows me to carry on as expected.
MembershipProvider 抽象类是 .net 4.0 Framework 中 System.Web.ApplicationServices 命名空间的一部分。添加对该程序集的引用,它应该可以解决问题。
The MembershipProvider abstract class is part of the System.Web.ApplicationServices namespace in the .net 4.0 Framework. Add a reference to that assembly and it should solve the issue.
就我而言,我使用的是 Visual Studio 2019,我需要添加这两个:
并且
为了在继承
MembershipProvider
上成功构建它以创建我自己的 MyMembershipProvider 类。On my case, I am using Visual Studio 2019, I need to add both of these:
and
In order to build it successfully upon inheriting
MembershipProvider
to create my own MyMembershipProvider class.未设置参考或缺少使用
命名空间是 System.Web.Security
检查是否引用了程序集 System.Web.ApplicationServices.dll
以获取更多信息 查看 MSDN
There is an reference not set oder an missing using
namespace is System.Web.Security
Check if assembly System.Web.ApplicationServices.dll is referenced
for more info checkt out MSDN