18

I'm searching for Microsoft.IdentityModel.Extensions library. In documentation that I'm reading they suggest that it should be available in my GAC, but its not. I'm using Visual Studio 2012.

Where can I find it?

ŁukaszW.pl
  • 9,244
  • 5
  • 34
  • 59

7 Answers7

10

Right click your project and opt for Manage NuGet Package and look for the following extension Windows Identity Foundation

Alternately, you can download it from here. Afterwards reinstalling the NuGet packages may be necessary: Update-Package –reinstall

Jack Miller
  • 4,734
  • 2
  • 32
  • 46
Sreejith Nair
  • 4,435
  • 4
  • 26
  • 43
  • 3
    It referenced `Microsoft.IdentityModel` but `Microsoft.IdentityModel.Extensions` is not part of it, its an separate library.. – ŁukaszW.pl May 22 '13 at 12:57
  • 1
    I have updated the answer with location where you can find it. – Sreejith Nair May 22 '13 at 13:07
  • Thanks, thats what i was looking for. – ŁukaszW.pl May 22 '13 at 13:07
  • Just had the same issue. Nuget did nothing. The only thing that worked for me was the installer from the Prerequisites section mentioned. It installs the DLL in your gac (the folder mentionedby rey garrido) and after that your good to go! existing project references to identitymodel.extensions should work, you don't need to do anything other than a rebuild. – Drkawashima Sep 29 '14 at 20:50
  • I have installed WIF and that dll but I am getting this error Error 1 'WSTrustChannelFactory' is an ambiguous reference between 'System.ServiceModel.Security.WSTrustChannelFactory' and 'Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannelFactory' – Waqas Dec 31 '14 at 10:30
2

In addition to Štefan Bartoš answer, my problem was fixed only after installing WIF using Visual Studio Installer. You can find it in Installation Details for SharePoint.

enter image description here

F.H.
  • 884
  • 1
  • 11
  • 26
shinagon
  • 21
  • 3
  • This actually works! You can also download WIF from https://www.microsoft.com/en-us/download/details.aspx?id=17331. Afterwards [reinstal the NuGet packages](https://stackoverflow.com/a/45726537/2484903) may be necessary. – Jack Miller Apr 08 '21 at 09:31
1

Search and install Windows Identity Foundation. One possibility is to use Nuget

PM> Install-Package Microsoft.IdentityModel
JeffRSon
  • 8,871
  • 3
  • 22
  • 47
  • 3
    I installed `Microsoft.IdentityModel` but `Extensions` namespace is not part of this library. It looks like it's an additional thing. – ŁukaszW.pl May 22 '13 at 12:55
1

To include Microsoft.IdentityModel.Extensions for WIF runtime support, perform the following steps:

  1. Download and install the WIF runtime and SDK for .NET Framework 4.0.
    Note that the Microsoft.IdentityModel assembly is located
    under the %Program Files%\Reference Assemblies\
    Microsoft\Windows Identity Foundation\v3.5 folder.
    
  2. Add reference to the Microsoft.IdentityModel, System.IdentityModel, and System. Configuration assemblies
Jatin patil
  • 4,140
  • 1
  • 15
  • 27
1

Okay after googling until my eyes bled and not finding a solution, I was able to fix the error not displaying my sharepoint 2013 site by taking the following steps:

  1. Go to the folder path > C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.IdentityModel.Extensions\v4.0_2.0.0.0__69c3241e6f0468ca

  2. If the path above its empty you have to find a copy of the Microsoft.IdentityModel.Extensions.dll and place it in the path above, in my case I had second working virtual machine so I copied the .DLL from there.

    In Windows 2008 server you could find a copy of the Microsoft.IdentityModel.Extensions.dll in the path below:

C:\inetpub\wwwroot\wss\VirtualDirectories\Portal80\bin

1

If you are having this problem in relation to Sharepoint development, then this cold be a solution.

My application was one that interacted with Sharepoint, originally using the AppForSharePointWebToolkit nuget package (in VS2013). When I tried to add this to my solution on a new development machine (using VS2017), I got the following error:

Failed to add reference. The package 'AppForSharePointWebToolkit' tried to add a framework reference to 'Microsoft.IdentityModel' which was not found in the GAC.

I finally found this Nuget package: https://www.nuget.org/packages/Microsoft.SharePointOnline.CSOM, which is by Microsoft and seems to give me all my Sharepoint classes, without requiring 'Microsoft.IdentityModel'.

JohnB
  • 401
  • 5
  • 7
0

My problem was to install Windows Identity Foundation from Visual Studio 2019. It was shown at VS startup. I tried to find it in VS Installer, but with no luck. However, you can check that you have installed this package in Program and features(appwiz.cpl). Microsoft Identity Extensions in Programs and features

So, do not ignore VS warning.

Štefan Bartoš
  • 314
  • 2
  • 6