我已将类库项目添加到我的应用程序中。
在我的一个类中,我需要使用 MembershipUser 类,但项目找不到它。我添加了对 System.Web、System.Web.Security 和 System.Security.Principal 的引用。
我不确定是什么问题。有人遇到过这个吗?
最佳答案
如果您使用的是 .NET 4.0,则需要引用 System.Web.ApplicationServices.dll
程序集。一如既往的 MembershipUser 的文档包含所有必要的信息:
Namespace: System.Web.Security
Assembly: System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)
在以前版本的框架中 MembershipUser类位于 System.Web.dll
程序集中。
关于c# - 类库找不到 MembershipUser,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4708280/