55

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!

Moory
  • 573
  • 1
  • 4
  • 5
  • I have fixed this by adding the following reference to the csproj file in notepad :( It works... – Moory Jun 08 '10 at 22:19

10 Answers10

53

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

Taras Alenin
  • 8,094
  • 4
  • 40
  • 32
  • 4
    The tooltip for this in Win8 Programs/Features says it's for WIF with .NET 3.5 or 4.0. WIF was integrated into .NET 4.5 so if you're developing in VS2012/.NET 4.5, just add references to System.IdentityModel/System.IdentityModel.Services. – pelazem Oct 07 '13 at 19:13
  • Including this NuGet package allowed me to deploy a website to Azure without the use of a VM and still have access to microsoft.identitymodel.dll - thanks! – Goose Nov 22 '13 at 17:31
  • when in doubt, Nuget! – jhilden Jul 09 '14 at 18:48
  • 2
    In Windows 10, this is not a Windows Feature anymore. Using the NuGet package option works brilliantly on Windows 10. – Koen Zomers Dec 02 '14 at 09:00
  • 3
    @KoenZomers, actually it *is* a Windows 10 feature. Right-click the taskbar Windows logo, select 'Programs and Features', click 'Turn Windows Features on or off', and in the dialog box that appears, check the box next to 'Windows Identity Foundation 3.5' – Monty Wild Nov 23 '15 at 23:06
52

Have you installed Windows Identity Foundation and the companion WIF SDK?

EBarr
  • 11,826
  • 7
  • 63
  • 85
Eugenio Pace
  • 14,094
  • 1
  • 34
  • 43
  • 11
    First should be installed Windows Identity Foundation http://www.microsoft.com/downloads/en/details.aspx?FamilyID=eb9c345f-e830-40b8-a5fe-ae7a864c4d76&displaylang=en – angularrocks.com Jan 27 '11 at 11:15
  • 4
    Could be added to your solution/project as a NuGet see my answer for a link. – Taras Alenin Oct 08 '12 at 04:08
  • Note that on Windows 10 you cannot install Windows Identity foundation anymore, this is now a Windows feature that needs to be enabled: https://dynamicsofdynamicscrm.com/2015/09/11/quick-tipenabling-windows-identity-foundation-on-windows-10-machines/ – Rémi Gaudin Jan 14 '19 at 12:04
41

If you've installed the WIF SDK, try :

C:\Program Files\Reference Assemblies\Microsoft\Windows Identity Foundation\v3.5\
   Microsoft.IdentityModel.dll
SteveC
  • 15,808
  • 23
  • 102
  • 173
TJ Amas
  • 1,291
  • 13
  • 19
12

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.

Monty Wild
  • 3,981
  • 1
  • 21
  • 36
6

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.

Jeppebm
  • 389
  • 1
  • 3
  • 16
2

In Windows 8.1 64bit, look under C:\Windows\ADFS

CarlS
  • 21
  • 1
2

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
Nikita R.
  • 7,245
  • 3
  • 51
  • 62
1

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.

Edward Weinert
  • 523
  • 1
  • 5
  • 9
  • 1
    Not that it matters much, but you only have to restart the ASP.NET Development Server, not all of Visual Studio. – sblom Nov 15 '12 at 17:53
1

Check namespace mapping changed after 3.5 see below URL for details. http://msdn.microsoft.com/en-us/library/jj157091.aspx

Sandip
  • 11
  • 1
0

Install Both of the below links

  1. Windows Identity Foundation

    Note: (For Vista and Windows Server 2008 >>> Windows6.0 and For Windows 7 and Windows Server 2008 R2, >>> Windows6.1. )

  2. 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