azurevisual-studio

Cannot log in to Visual Studio Account in VS 2022


When click the login button on visual studio, I am presented with an error and then VS becomes totally unresponsive:

trying to login

The error reads as follows

We could not add the account
Unknown Status: Unexpected
Error: 0xffffffff80070520
Context: Unexpected exception while waiting for accounts control to finish:
        'A specified logon session does not exist. It may already have been terminated.'
Tag: 0x1f7d734b (error code -2147023584) (internal error code 528315211)

We use TFS to do our source control, but searching online for solutions, this error always seems to be associated with Git (or maybe it's just more popular?), so solutions mention the GCM credential helper that is an option with Git, but does not apply to TFS.

I can't access the TFS server through VS either - when I first open it up, I see this message in the output window:

TF205020: Could not connect to server ‘[server]’. This server was used in your last session, but it might be offline or unreachable.
Confirm that the server is available on the network. To attempt to connect again, or to a different server, click ‘Connect To Azure DevOps Server’ in Team Explorer or the Team menu.

The server returned the following error: TF30063: You are not authorized to access [server].

I was able to confirm that the TFS server is available on the network; I can log in and access it in my browser using the same account. I clicked Help->My Subscription->Benifits and when that opened up in the browser, I could log in fine there as well.

Yesterday afternoon, the account that I am using was locked out of Windows, but it was reinstated in Active Directory - This is the first time I am logging into VS since then, which seems like strong circumstancial evidence for the cause of the problem!

How can I log in?

EDIT - Adding additional info:

I uninstalled Visual Studio 2022, then reinstalled and got the logon window as part of my first time opening the newly installed application, but the same error appeared.

New Installation, same Error


Solution

  • enter image description hereIt seems to have resolved for me... only by luck. Steps followed Link: Click here I tried this In the "Account Settings" window click "Account options", change the drop-down for "Add and reauthenticate account using:" from "Embedded web browser" to "System web browser". but it did not open the browser after few attempts, so put the setting back to Embedded. Tried login again and it worked.

    Open VS 2022 -> Tools (at the very top) -> Options , search for connect, see under Environment -> accounts , then follow rest of the steps as above