添加对System.IdentityModel.Tokens DLL的引用

ADH*_*ADH 4 asp.net-mvc-4 .net-4.5 asp.net-4.5

如何添加对System.IdentityModel.Tokens dll的引用?

它似乎没有出现在Nuget Package Manager中.

我需要下载DLL吗?

我安装了.Net 4.5.

如果没有引用,以下代码将无法编译:

SessionSecurityToken sst = e.SessionToken;
Run Code Online (Sandbox Code Playgroud)

Tom*_*mmy 5

在您的解决方案中,右键单击References文件夹并选择"Add Reference"

从Assemblies-> Framework(.NET 4.5)列表中,选择(选中)System.IdentityModel,然后按确定.

将using语句添加到类的顶部 - using System.IdentityModel.Tokens;


use*_*148 5

它确实存在于NuGet上,最新发布于2013-02-08,所以我不明白为什么找不到它。尝试搜索System.IdentityModel.Tokens.ValidatingIssuerNameRegistry。最好的安装方法是使用NuGet数据包管理器。

您可以在以下位置找到该软件包:https : //www.nuget.org/packages/System.IdentityModel.Tokens.ValidatingIssuerNameRegistry/4.5.0