SOLVED

The type or namespace name 'S2S' does not exist in the namespace 'Microsoft.IdentityModel'

%3CLINGO-SUB%20id%3D%22lingo-sub-37570%22%20slang%3D%22en-US%22%3EThe%20type%20or%20namespace%20name%20'S2S'%20does%20not%20exist%20in%20the%20namespace%20'Microsoft.IdentityModel'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37570%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20new%20to%20development%20against%20the%20PnP-Sites-Core%20solution.%20After%20downloading%20the%20solution%20from%20GitHub%2C%20the%20initial%20build%20fails%20and%20I'm%20not%20sure%20why.%20The%20restoration%20of%20all%20Nuget%20packages%20seems%20to%20work%2C%20but%20I%20can't%20build%20the%20solution%20because%20%22The%20type%20or%20namespace%20name%20'S2S'%20does%20not%20exist%20in%20the%20namespace%20'Microsoft.IdentityModel'.%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can't%20figure%20out%20what%20assembly%20reference%20I'm%20missing%20or%20what%20I'm%20doing%20wrong.%20Any%20ideas%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-108735%22%20slang%3D%22en-US%22%3ERe%3A%20The%20type%20or%20namespace%20name%20'S2S'%20does%20not%20exist%20in%20the%20namespace%20'Microsoft.IdentityModel'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-108735%22%20slang%3D%22en-US%22%3E%3CP%3ETrying%20to%20follow%20sample%20code%20within%20Office%20Dev%20Center.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHaving%20the%20same%20issue%20in%20that%20the%20%3CSTRONG%3ESharepointContextToken%3C%2FSTRONG%3E%3B%20%3CSTRONG%3ESharepointContextProvider%3C%2FSTRONG%3E%20is%20not%20recongized.%20%26nbsp%3BI%20have%20added%20the%20Microsoft%20Identy%20Model%20and%20the%20mentioned%20SharepointPNP%20Identy%20Model%20Extensions%20as%20explained%20above%20to%20my%20project.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20the%20sample%20code%20need%20to%20change%3F%20%26nbsp%3BIts%20location%20is%20here%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdev.office.com%2Fsharepoint%2Fdocs%2Fsp-add-ins%2Fget-started-creating-provider-hosted-sharepoint-add-ins%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdev.office.com%2Fsharepoint%2Fdocs%2Fsp-add-ins%2Fget-started-creating-provider-hosted-sharepoint-add-ins%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-39231%22%20slang%3D%22en-US%22%3ERe%3A%20The%20type%20or%20namespace%20name%20'S2S'%20does%20not%20exist%20in%20the%20namespace%20'Microsoft.IdentityModel'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-39231%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20now%20removed%20the%20dependency%20to%20Microsoft.IdentityModel.Extensions%20and%20replaced%20it%20with%20our%20own%2C%20which%20will%20be%20distributed%20with%20PnP%20Core.%20As%20of%20the%20next%20release%20the%20requirement%20to%20install%20the%20Office%20Developer%20Tools%20will%20be%20gone.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-39196%22%20slang%3D%22en-US%22%3ERe%3A%20The%20type%20or%20namespace%20name%20'S2S'%20does%20not%20exist%20in%20the%20namespace%20'Microsoft.IdentityModel'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-39196%22%20slang%3D%22en-US%22%3E%3CP%3EI%20was%20able%20to%20resolve%20by%20installing%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.visualstudio.com%2Fvs%2Foffice-tools%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOffice%20Developer%20Tools%3C%2FA%3E.%20%26nbsp%3BNoticed%20Windows%20Idenity%20stuff%20installed%20on%20confirmation%20screen%20(see%20attachment).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-37679%22%20slang%3D%22en-US%22%3ERe%3A%20The%20type%20or%20namespace%20name%20'S2S'%20does%20not%20exist%20in%20the%20namespace%20'Microsoft.IdentityModel'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37679%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20are%20aware%20of%20the%20issue.%20The%20file%20gets%20installed%20the%20moment%20you%20install%20the%20office%20developer%20addons%20in%20Visual%20Studio.%20So%20if%20you%20have%20a%20'clean'%20VS%20installation%20the%20file%20is%20not%20there%20unfortunately.%20I%20will%20discuss%20this%20with%20the%20team.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-37674%22%20slang%3D%22en-US%22%3ERe%3A%20The%20type%20or%20namespace%20name%20'S2S'%20does%20not%20exist%20in%20the%20namespace%20'Microsoft.IdentityModel'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37674%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20problem%20appears%20to%20be%20related%20to%20Microsoft.IdentityModel.Extensions.%20Maybe%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F122%22%20target%3D%22_blank%22%3E%40Erwin%20van%20Hunen%3C%2FA%3E%26nbsp%3Bor%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F369%22%20target%3D%22_blank%22%3E%40Vesa%20Juvonen%3C%2FA%3E%26nbsp%3Bcan%20help%3F%20%3Cimg%20id%3D%22smileyhappy%22%20class%3D%22emoticon%20emoticon-smileyhappy%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fi%2Fsmilies%2F16x16_smiley-happy.png%22%20alt%3D%22Smiley%20Happy%22%20title%3D%22Smiley%20Happy%22%20%2F%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20running%20the%20code%20as-is%20from%20GitHub.%20The%20reference%20to%20Microsoft.IdentityModel%20in%20my%20local%20copy%20is%20C%3A%5CProgram%20Files%5CReference%20Assemblies%5CMicrosoft%5CWindows%20Identity%20Foundation%5Cv3.5%5CMicrosoft.IdentityModel.dll.%20I%20changed%20it%20to%20match%20what%20you%20have%20and%20that%20did%20not%20make%20any%20difference.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20is%20no%20Nuget%20package%20for%20Microsoft.IdentityModel%20in%20the%20solution%2C%20so%20I%20did%20not%20install%20one.%20Here%20are%20the%20steps%20I'm%20taking.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3COL%3E%3CLI%3EDownload%20PnP-Sites-Core%20as%20a%20.zip%20from%20GitHub%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2FPnP-Sites-Core%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FSharePoint%2FPnP-Sites-Core%3C%2FA%3E.%3C%2FLI%3E%3CLI%3EExtract%20the%20files%20somewhere%20locally.%3C%2FLI%3E%3CLI%3EOpen%20OfficeDevPnP.Core.sln%20in%20Visual%20Studio%202015%20Community%20Edition%20(running%20as%20admin)%3C%2FLI%3E%3CLI%3EBuild%20the%20solution.%3COL%3E%3CLI%3ENuget%20packages%20are%20restored%3C%2FLI%3E%3CLI%3EBuild%20fails%3C%2FLI%3E%3CLI%3ESolution%20Explorer%20indicates%20that%20it%20can't%20find%20Microsoft.IdentityModel.Extensions%3C%2FLI%3E%3C%2FOL%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20350px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F9643i8C90EC894F7CACCF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222017-01-04_8-58-05.png%22%20title%3D%222017-01-04_8-58-05.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhere%20can%20I%20get%20Microsoft.IdentityModel.Extensions%3F%20There%20is%20a%20Nuget%20package%20for%20that%2C%20but%20it's%20not%20supported%20by%20Microsoft%20and%20therefore%20we%20can't%20use%20it%20with%20this%20solution.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20538px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F9644iCC7D9D8D44F4D1F5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222017-01-04_9-01-34.png%22%20title%3D%222017-01-04_9-01-34.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-37616%22%20slang%3D%22en-US%22%3ERe%3A%20The%20type%20or%20namespace%20name%20'S2S'%20does%20not%20exist%20in%20the%20namespace%20'Microsoft.IdentityModel'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37616%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F2734%22%20target%3D%22_blank%22%3E%40Eric%20Skaggs%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20you%20check%20the%20reference%20to%20Microsoft.Identity%20Model%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20my%20case%20it%20is%20set%20to%3A%3C%2FP%3E%3CP%3EC%3A%5CWINDOWS%5Cassembly%5CGAC_MSIL%5CMicrosoft.IdentityModel%5C3.5.0.0__31bf3856ad364e35%5CMicrosoft.IdentityModel.dll%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20version%20of%20the%20Nuget%20package%20have%20you%20got%20installed%20for%20Microsofty.IdentityModel%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-737064%22%20slang%3D%22en-US%22%3ERe%3A%20The%20type%20or%20namespace%20name%20'S2S'%20does%20not%20exist%20in%20the%20namespace%20'Microsoft.IdentityModel'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-737064%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F79807%22%20target%3D%22_blank%22%3E%40Lisa%20Mendez%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20need%20to%20use%20NuGet%20in%20your%20solution%20and%20add%20Microsoft.Identity.Model.Extension.%26nbsp%3B%20You%20can%20do%20this%20from%20within%20visual%20studio%20starting%20with%202017.%26nbsp%3B%20I%20just%20did%20it%20with%202019%20and%20now%20the%20sample%20app%20compiles.%26nbsp%3B%20Hope%20you%20found%20the%20solution%2C%20since%20you%20posted%20this%20question%202%20years%20ago.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I'm new to development against the PnP-Sites-Core solution. After downloading the solution from GitHub, the initial build fails and I'm not sure why. The restoration of all Nuget packages seems to work, but I can't build the solution because "The type or namespace name 'S2S' does not exist in the namespace 'Microsoft.IdentityModel'."

 

I can't figure out what assembly reference I'm missing or what I'm doing wrong. Any ideas?

7 Replies
Highlighted

Hi @Eric Skaggs,

 

Can you check the reference to Microsoft.Identity Model?

 

In my case it is set to:

C:\WINDOWS\assembly\GAC_MSIL\Microsoft.IdentityModel\3.5.0.0__31bf3856ad364e35\Microsoft.IdentityModel.dll

 

What version of the Nuget package have you got installed for Microsofty.IdentityModel?

 

Highlighted

The problem appears to be related to Microsoft.IdentityModel.Extensions. Maybe @Erwin van Hunen or @Vesa Juvonen can help? Smiley Happy

 

I am running the code as-is from GitHub. The reference to Microsoft.IdentityModel in my local copy is C:\Program Files\Reference Assemblies\Microsoft\Windows Identity Foundation\v3.5\Microsoft.IdentityModel.dll. I changed it to match what you have and that did not make any difference.

 

There is no Nuget package for Microsoft.IdentityModel in the solution, so I did not install one. Here are the steps I'm taking.

 

  1. Download PnP-Sites-Core as a .zip from GitHub: https://github.com/SharePoint/PnP-Sites-Core.
  2. Extract the files somewhere locally.
  3. Open OfficeDevPnP.Core.sln in Visual Studio 2015 Community Edition (running as admin)
  4. Build the solution.
    1. Nuget packages are restored
    2. Build fails
    3. Solution Explorer indicates that it can't find Microsoft.IdentityModel.Extensions

2017-01-04_8-58-05.png

 

Where can I get Microsoft.IdentityModel.Extensions? There is a Nuget package for that, but it's not supported by Microsoft and therefore we can't use it with this solution.

 

2017-01-04_9-01-34.png

Highlighted

We are aware of the issue. The file gets installed the moment you install the office developer addons in Visual Studio. So if you have a 'clean' VS installation the file is not there unfortunately. I will discuss this with the team.

Highlighted

I was able to resolve by installing the Office Developer Tools.  Noticed Windows Idenity stuff installed on confirmation screen (see attachment).

Highlighted
Solution

We now removed the dependency to Microsoft.IdentityModel.Extensions and replaced it with our own, which will be distributed with PnP Core. As of the next release the requirement to install the Office Developer Tools will be gone.

Highlighted

Trying to follow sample code within Office Dev Center.

 

Having the same issue in that the SharepointContextToken; SharepointContextProvider is not recongized.  I have added the Microsoft Identy Model and the mentioned SharepointPNP Identy Model Extensions as explained above to my project.

 

Does the sample code need to change?  Its location is here:

https://dev.office.com/sharepoint/docs/sp-add-ins/get-started-creating-provider-hosted-sharepoint-ad...

Highlighted

@Lisa Mendez 

 

You need to use NuGet in your solution and add Microsoft.Identity.Model.Extension.  You can do this from within visual studio starting with 2017.  I just did it with 2019 and now the sample app compiles.  Hope you found the solution, since you posted this question 2 years ago.