Forum Discussion
The type or namespace name 'S2S' does not exist in the namespace 'Microsoft.IdentityModel'
- Jan 13, 2017
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.
The problem appears to be related to Microsoft.IdentityModel.Extensions. Maybe Erwin van Hunen or VesaJuvonen can help? :smileyhappy:
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.
- Download PnP-Sites-Core as a .zip from GitHub: https://github.com/SharePoint/PnP-Sites-Core.
- Extract the files somewhere locally.
- Open OfficeDevPnP.Core.sln in Visual Studio 2015 Community Edition (running as admin)
- Build the solution.
- Nuget packages are restored
- Build fails
- Solution Explorer indicates that it can't find Microsoft.IdentityModel.Extensions
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.
I was able to resolve by installing the https://www.visualstudio.com/vs/office-tools/. Noticed Windows Idenity stuff installed on confirmation screen (see attachment).
- Jan 13, 2017
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.
- Lisa MendezSep 21, 2017Copper Contributor
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-add-ins
- KingduncanJul 03, 2019Copper Contributor
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.