在visual studio 2015 RC中运行以下代码时出现以下错误,但同样的代码在visual studio 2013中运行完美。
对'SecureString'类型的引用声称它在'mscorlib'中定义,但无法找到
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;
}