要么我迟到了,要么我做错了什么。我正在使用 Visual Studio 2013 并且我试图使用 Membership 类但是,using System.Web.Security;
我的程序集中不存在命名空间。
我能做些什么来解决这个问题?
注:System.Web
存在
目标:.NET Framework 4.5.1
要么我迟到了,要么我做错了什么。我正在使用 Visual Studio 2013 并且我试图使用 Membership 类但是,using System.Web.Security;
我的程序集中不存在命名空间。
我能做些什么来解决这个问题?
注:System.Web
存在
目标:.NET Framework 4.5.1
实际上,在.Net Framework 4+中,命名空间System.Web.Security
位于System.Web.ApplicationServices
程序集中,请在参考资料中查找
System.Web 命名空间存在于 System.dll 中
System.Web.Security 命名空间存在于 System.Web.dll
您可以通过转到System.Web和System.Web.Security命名空间、打开其中一个类并检查 msdn 文章中的 dll (列为程序集)来检查这一点。
我想我来晚了,但如果有人没有得到答案,我终于在这里找到了:
https://msdn.microsoft.com/en-us/library/webmatrix.webdata.websecurity(v=vs.111).aspx
添加对:WebMatrix.WebData 的引用(您需要选择“扩展”)并且您将拥有可用的 WebSecurity
注意:对于 MemberShip 和 MemberShipUser,您仍然需要 (System.Web.Security)
将Target 框架从.net 客户端配置文件 ** 更改为 **.net
通过引用添加System.Web
程序集->右键单击->添加引用->.net
在顶部添加using System.Web.Security;