ADAL authnetication error

5/7/2015

Using Azure AD Authentication Library for .NET,  tried using the AuthenticationContext class to authenticate with the AZure AD.  Following line kept on throwing the error

 AuthenticationContext ac = new AuthenticationContext(authority);

Error:

The type initializer for 'Microsoft.IdentityModel.Clients.ActiveDirectory.Authenticator' threw
an exception.

I had used the nuget package manager to get the latest version of it.

the solution is to simply do a right click on the Source Explorer window of the Visual Studio   and  click Manage NuGet Package and choose a different version rather than the latest one.

I sitll could not figure out , if it is a problem with the latest package or something else on my PC. But taking a different version ( 2.11.0.0) did the trick

Name

Email

WebSite