在Visual Studio Community 2017中,我们无法刷新该帐户的凭据。如何解决?

时间:2018-09-27 12:42:27

标签: visual-studio-2017

我无法登录Visual Studio Community2017。如果输入我的Microsoft凭据,则会弹出此消息:

enter image description here

我已经尝试过类似问题中列出的每件事:Visual Studio 2017 - How to fix error: We could not refresh the credentials for the account

但是它们不起作用(试图删除IdentityService文件夹内容和文件夹本身;试图通过安装程序进行修复)或无法完成(我无法访问“帮助”项目菜单:没有整个应用程序登录均已锁定)。

登录文件

我该如何解决? C:\Users\user\AppData\Local\Temp\servicehub\logs\AadAccountProviderService-10304-v05lxa0n-1显示:

09/27/2018 14:37:56 : Error : There was a problem getting the access token using the prompt with UI flow. Error: 'Microsoft.IdentityService.Clients.ActiveDirectory.AdalServiceException: AADSTS70002: Error validating credentials. AADSTS40016: The identity provider returned an error. The status returned was 'BadRequest' and the message was '{"error":"invalid_grant","error_description":"The user could not be authenticated or the grant is expired. The user must first sign in and if needed grant the client application access to the requested scope."}'.
Trace ID: fd00d736-cee6-4093-bce8-0aa4fff7c900
Correlation ID: 0dfc7dad-cb24-4b7f-9a9b-f926f9f7b493
Timestamp: 2018-09-27 12:37:56Z
   at Microsoft.IdentityService.Clients.ActiveDirectory.AcquireTokenInteractiveHandler.VerifyAuthorizationResult()
   at Microsoft.IdentityService.Clients.ActiveDirectory.AcquireTokenInteractiveHandler.<PreTokenRequest>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.IdentityService.Clients.ActiveDirectory.AcquireTokenHandlerBase.<RunAsync>d__57.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityService.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenCommonAsync>d__42.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityService.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenAsync>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Developer.IdentityService.AccountProvider.NetworkServicesImpl.<AcquireTokenWithPromptInternalAsync>d__21.MoveNext()
    ErrorCode: invalid_grant
    StatusCode: 0'
09/27/2018 14:37:56 : Error : CreateAccount: Creating an account. QueryParameters 'site_id=501454&display=popup&nux=1&lc=1033'
Account creation failed. 
Error: 'Microsoft.IdentityService.Clients.ActiveDirectory.AdalServiceException: AADSTS70002: Error validating credentials. AADSTS40016: The identity provider returned an error. The status returned was 'BadRequest' and the message was '{"error":"invalid_grant","error_description":"The user could not be authenticated or the grant is expired. The user must first sign in and if needed grant the client application access to the requested scope."}'.
Trace ID: fd00d736-cee6-4093-bce8-0aa4fff7c900
Correlation ID: 0dfc7dad-cb24-4b7f-9a9b-f926f9f7b493
Timestamp: 2018-09-27 12:37:56Z
   at Microsoft.IdentityService.Clients.ActiveDirectory.AcquireTokenInteractiveHandler.VerifyAuthorizationResult()
   at Microsoft.IdentityService.Clients.ActiveDirectory.AcquireTokenInteractiveHandler.<PreTokenRequest>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.IdentityService.Clients.ActiveDirectory.AcquireTokenHandlerBase.<RunAsync>d__57.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityService.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenCommonAsync>d__42.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityService.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenAsync>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Developer.IdentityService.AccountProvider.NetworkServicesImpl.<AcquireTokenWithPromptInternalAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Developer.IdentityService.AccountProvider.AadAccountProviderService.<CreateAccountAsync>d__25.MoveNext()
    ErrorCode: invalid_grant
    StatusCode: 0'

1 个答案:

答案 0 :(得分:1)

通过打开开发人员命令提示符(“开始”菜单->开发人员命令提示符)并运行来解决此问题

Set SERVICEHUBTRACELEVEL=Verbose
devenv /log

这启动了Visual Studio,我可以从那里登录。由于某种原因,我忽略了这并没有导致错误消息。