我正在学习 .NET 4.5 中新的基于声明的身份验证方法,并且正在使用控制台应用程序来执行此操作。根据 MSDN here , ClaimsAuthenticationManager 是 System.Security.Claims 命名空间的成员。正如您在这里看到的,我没有得到这个选项。我已确定该项目使用的是 .NET 4.5。我在这里遗漏了一些简单的东西……有人有什么建议吗?
最佳答案
您需要添加对 System.IdentityModel.dll
的引用
您可以在 ClaimsAuthenticationManager
的文档中看到这一点:
Namespace: System.Security.Claims
Assembly: System.IdentityModel (in System.IdentityModel.dll)
关于c# - System.Security.Claims 命名空间的成员不可用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17409501/