可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I have installed the Windows Identity Foundation but can't find the Microsoft.IdentityModel dll. According to the Azure Hands-on-Labs it should just be in Add Reference in VS2010. However it's not there.
I also looked in c:\Program Files(x86)\Windows Identity Foundation* and it's not in there (or the 64 bit program files folder).
Help!
回答1:
Have you installed Windows Identity Foundation and the companion WIF SDK?
回答2:
How about a NuGet Windows Identity Foundation. Just add it you you project and away you go! Its one of the MS owned NuGets so should be maintained accordingly.
EDIT: In Windows 8 Windows Identity Foundation is installed (enabled) by turning a windows feature on in Control Panel > All Control Panel Items > Programs and Features > Turn Windows feature on or off the feature is Windows Identity Foundation 3.5. Installers linked in the answer above will not work on Windows 8
回答3:
If you've installed the WIF SDK, try :
C:\Program Files\Reference Assemblies\Microsoft\Windows Identity Foundation\v3.5\
Microsoft.IdentityModel.dll
回答4:
I had this problem, but fixed it by referencing the DLL from
"C:\Program Files\Reference Assemblies\Microsoft\Windows Identity Foundation\v3.5\Microsoft.IdentityModel.dll"
Go to reference properties and set Copy Local to True for the DLL. The DLL will now be included in the azure package.
回答5:
For Windows 10:
Right-click the taskbar Windows logo, select 'Programs and Features'.
Click 'Turn Windows Features on or off'
In the dialog box that appears, scroll down or resize the window and check the box next to 'Windows Identity Foundation 3.5'
Click OK.
This activates the required DLLs. Apparently Windows 10 keeps all of those features in the windows installation so that it can activate and deactivate them on demand.
回答6:
I had a similar problem. I got an exception "Type is not resolved for member 'Microsoft.IdentityModel.Claims.ClaimsPrincipal, Microsoft.IdentityModel, Version = 3.5.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35'.".
I tried to run the ASP.NET application from Visual Studio, which was a reference to a local copy of Microsoft.IdentityModel.dll.
I did not want to install the SDK and I had to copy the library to the directory "C: \ Program Files \ Common Files \ Microsoft Shared \ DevServer \ 10.0" and restart Visual Studio.
回答7:
In Windows 8.1 64bit, look under C:\Windows\ADFS
回答8:
In Windows 8 and up there's a way to enable the feature from the command line without having to download/install anything explicitly by running the following:
dism /online /Enable-Feature:Windows-Identity-Foundation
And then find the file by running the following at the root of your Windows disk:
dir /s /b Microsoft.IdentityModel.dll
回答9:
Check namespace mapping changed after 3.5 see below URL for details.
http://msdn.microsoft.com/en-us/library/jj157091.aspx
回答10:
Install Both of the below links
Windows Identity Foundation
Note: (For Vista and Windows Server 2008 >>> Windows6.0 and
For Windows 7 and Windows Server 2008 R2, >>> Windows6.1. )
Windows Identity Foundation SDK
Note: Download the 3.5 version for Visual Studio 2008 and .NET 3.5, the 4.0 version for Visual Studio 2010 and .NET 4.0.
Then Only, You will able to get the assembly called Microsoft.IdentityModel