我已经安装了Windows身份验证基础结构,但找不到Microsoft.IdentityModel dll。根据Azure Hands-on-Labs的说法,它应该出现在VS2010中的“添加引用”中。然而,它并没有出现。
我还查看了 c:\Program Files(x86)\Windows Identity Foundation* ,但在那里也没有找到(或者是64位程序文件夹中也没有)。
求助!
我已经安装了Windows身份验证基础结构,但找不到Microsoft.IdentityModel dll。根据Azure Hands-on-Labs的说法,它应该出现在VS2010中的“添加引用”中。然而,它并没有出现。
我还查看了 c:\Program Files(x86)\Windows Identity Foundation* ,但在那里也没有找到(或者是64位程序文件夹中也没有)。
求助!
你可以考虑使用NuGet Windows Identity Foundation。只需将其添加到项目中,就可以开始使用了!这是MS拥有的NuGet之一,因此应该得到相应的维护。
编辑:在Windows 8中,可以通过在控制面板>所有控制面板项>程序和功能>打开或关闭Windows功能中启用Windows Identity Foundation来进行安装(启用)。该功能是Windows Identity Foundation 3.5。上面答案中提供的安装程序无法在Windows 8上运行。
您是否已安装了Windows身份验证基础架构和配套的WIF SDK?
如果您已经安装了WIF SDK,请尝试以下方法:
C:\Program Files\Reference Assemblies\Microsoft\Windows Identity Foundation\v3.5\
Microsoft.IdentityModel.dll
对于Windows 10:
右键单击任务栏Windows徽标,选择“程序和功能”。
点击“启用或关闭Windows功能”
在弹出的对话框中,向下滚动或调整窗口大小,并勾选“Windows身份验证基础结构3.5”旁边的复选框
点击确定。
这将激活所需的DLL文件。显然,Windows 10将所有这些功能保存在Windows安装中,以便可以根据需要激活和停用它们。
dism /online /Enable-Feature:Windows-Identity-Foundation
然后在您的Windows磁盘根目录下运行以下命令来查找文件:
dir /s /b Microsoft.IdentityModel.dll
3.5版本后,检查命名空间映射是否有更改,详细信息请查看以下链接: http://msdn.microsoft.com/en-us/library/jj157091.aspx
我曾经遇到过类似的问题。我收到了一个异常信息:“Type is not resolved for member 'Microsoft.IdentityModel.Claims.ClaimsPrincipal, Microsoft.IdentityModel, Version = 3.5.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35'."。
我尝试从Visual Studio运行ASP.NET应用程序,该应用程序引用了本地副本的Microsoft.IdentityModel.dll。
我不想安装SDK,所以我必须将库复制到目录“C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0”中,并重新启动Visual Studio。
安装以下两个链接
注意: (对于Vista和Windows Server 2008 >>> Windows6.0和 对于Windows 7和Windows Server 2008 R2,>>> Windows6.1。)
Windows Identity Foundation SDK
注意: 下载Visual Studio 2008和.NET 3.5的3.5版本,下载Visual Studio 2010和.NET 4.0的4.0版本。
然后,您才能获得名为Microsoft.IdentityModel的程序集。