Below is the error when I run the code below in visual studio 2015 RC, but the same code snippet works fine in visual studio 2013.
The type reference "SecureString" claims to be defined in "mscorlib", but could not be found
public static AuthenticationResult GetAccessToken(string strAuthority, string strClientId, string strAppKey, string strResourceID) { AuthenticationResult token = null; ClientCredential clientCredential = null; AuthenticationContext authContext = null; authContext = new AuthenticationContext(strAuthority); clientCredential = new ClientCredential(strClientId, strAppKey); int retryCount = 0; bool retry = false; do { retry = false; try { token = authContext.AcquireToken(strResourceID, clientCredential); } catch (AdalException ex) { if (ex.ErrorCode == "temporarily_unavailable") { retry = true; retryCount++; } } } while ((retry == true) && (retryCount < 3)); return token; }
source share