问题
I am trying to follow along with this tutorial from Microsoft, https://dev.outlook.com/restapi/tutorial/dotnet, to use the Outlook REST API's with an app I'm building on Visual Studio 2013. I am using the .NET framework v4.
I am stuck on step 4. Implementing OAuth2. Specifically I am unable to install the Active Directory Authentication Library (ADAL) in NuGet Package Manager.
Originally, I tried to install the Active Directory Authentication Library (ADAL) on VS 2012, but soon discovered after consulting Stackoverflow that 2012 is not compatible with the REST API's. In the NuGet Package Manager Console I entered this line of code:
Install-Package Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory -Version 4.0.208020147-alpha -Pre
And got this error:
http://i66.tinypic.com/w1rb0y.jpg
So then I upgraded to VS 2013, installed the latest update (5), installed Microsoft Office 365 Development Tools, Microsoft ASP.NET and Web Tools, and updated NuGet. Again, in the NuGet Package Manager Console I entered this line of code:
Install-Package Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory -Version 4.0.208020147-alpha -Pre
But then I got this near identical error:
http://i65.tinypic.com/2lclf6a.jpg
I thought that after installing a newer version of Visual Basic, I wouldn't get the same error. But not so.
I checked in my registry, and I have .NET framework versions 2-4 installed. I assume, because I didn't see the FULL folder. Is the ADAL not compatible with versions 1-4? Do I need to install v4.5? Is there something else going on?
*Update: I just tried to download .Net framework 4.5 but a popup said it or a more recent version is already installed.
*Update: I just tried to install the more recent verion of the ADAL
Install-Package Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory -Pre
but I got the same errors as before.
回答1:
Set your Target Framework to 4.5* in the project properties and see if that doesn't fix it. The tutorial was written that way.
来源:https://stackoverflow.com/questions/36752049/active-directory-authentication-library-adal-wont-install-visual-studio-2013