SecureString声称它是在mscorlib中定义的,但在visual studio 2015 RC中找不到它

时间:2015-05-16 10:09:19

标签: adal

在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;
    }

0 个答案:

没有答案