Cannot Add GitHub Account from Visual Studio 2022 Account Settings
Asked Answered
C

9

11

I have just upgraded from Visual Studio 2019 to Visual Studio 2022 and I have encountered a strange problem. When going to File -> Account Settings..., under "All Accounts" I used to have both my Microsoft account (which is also my Personalization Account) and my GitHub account. In VS 2019, there was no issue adding the GitHub account, but I have not been successful in VS 2022. When I select +Add▾ then GitHub/GitHub Account, the Connect to GitHub dialog pops up asing me to Sign In to either GitHub or GitHub Enterprise. Since my account is GitHub and not GitHub Enterprise, the only sign in option listed is "Sign in with your browser".

When I select Sign in with your browser, I get redirected to https://visualstudio.microsoft.com/vs/github-signed-in/ and I get the message "Success! Your authorization was successful. You can now return to Visual Studio."

The expected result at that point would be to see my GitHub account listed under All Accounts, but I do not. The other expected result would be to see Visual Studio listed in my GitHub account under Authorized OAuth Apps, and I do see it there, so it does look like the authorization was successful. As well, I can access repositories without issue, so it looks like the problem is inside Visual Studio 2022.

Has anyone else experienced this issue? Is this a known issue that Microsoft is working on?

EDIT: I found this on the Microsoft Docs, which lays out the steps I was following. Under Adding public GitHub Accounts, I get to Step 3 ok, but then at Step 4, I do not get the expected result.

I've also found out this is preventing me from creating a new repository from VS, or opening a repository directly from VS. I can still work with local repositories cloned via GitHub Desktop, but that's about it.

Very annoying.

Chaps answered 12/1, 2022 at 17:10 Comment(3)
I am seeing exactly the same. I've opened a case with Microsoft, sending logs and a screen recording.Najera
@MatthewHazzard any response? It appears that setting Edge as a default browser temporarily may fix it (worked for me) (reported here first).Seabolt
Turns out it was a credential store issue: some tasks were just adding new credentials rather than replacing, so there were too many old ones and it was "full". Running Credential Manager and removing the no-longer-valid credentials worked.Chaps
A
1

I had same issue.

What helped was to update to latest VS 2022 and run Credential Manager and remove some of the old passwords (I deleted some pass from windows and web credentials, dont know which helped).

See: https://developercommunity.visualstudio.com/t/Problem-adding-Github-Account/10416187

Amylopectin answered 24/8, 2023 at 18:31 Comment(2)
That did the job for me many thanks !Luminosity
This is what worked for me in the end, clearing out the Windows Credential Store.Chaps
S
5

In VS enable 'Sign in with Device Flow'. It's under options/Github/Copilot. You'll be given a code and redirected to the Github website to enter the code.

Scabious answered 28/12, 2023 at 11:48 Comment(1)
this is what worked for me: I had to launch VS 2022 as another user as my main one to use the integrated security in database connections. Nothing worked as my other user.Troyes
S
4

Make Edge your default browser.

I encountered this same problem. I enabled "use system web browser" in Visual Studio account settings - still did not work. Then I made Edge my default browser, retried the GitHub login in VS and everything was magically fixed.

Suitable answered 29/4, 2023 at 12:14 Comment(1)
This is actually an excellent suggestion. The reason you keep seeing "Success! Your authorization was successful." is because a non-Edge browser keeps you logged in. This trick worked for me (and now quickly switching away from Edge again).Seabolt
N
3

I had a suspicion that this was related to some type of settings cache or potentially some type of previous Git setting. After wiping out all of my Visual Studio settings and re-setting to factory defaults (which is another annoyance) using the following commands, it started working for me:

devenv.exe /ResetSettings
devenv.exe /ResetUserData
Najera answered 23/3, 2022 at 20:3 Comment(3)
Thanks, @matthew-hazzard, I tried that (after backing up my current settings so I could re-import), but it did not work for me. My GitHub account still does not show up.Chaps
Actually helped in my case: resetted user data and reentered credentials; was getting the error: "There was a problem adding your GitHub account." before. Thanks!Cerelia
@Jurion please remain polite. Saying something is "dumb" is not helping anyone. This is a collaborative website. You can improve the answer as you clearly have an opinion on it. Or provide constructive criticism, detailing what you're missing, or what errors you see, so that someone else may improve instead.Seabolt
O
1

This worked for me:

Open ‘Account options’(Click ‘Account options’ in account settings page or navigate to tools > Options > Environment > Accounts) and check ‘Include GitHub Enterprise Server accounts’ checkbox, then click on “Re-enter your credentials” again and check if you still unable to sign in to GitHub enterprise account?

https://developercommunity.visualstudio.com/t/unable-to-sign-in-to-github-enterprise-account-in/1460790#T-N1465373

Organ answered 16/2, 2022 at 16:39 Comment(1)
I'm not using a GitHub Enterprise Server account, so that option does not apply to me.Chaps
S
1

When I clicked Manage Connections, the GitHub option wasn't available in the usual spot. Only the Microsoft Sign on. I found another spot to connect to GitHub;

  • Open the Team Explorer (View -> Team Explorer).
  • Click the Connect | Offline drop down from the top of the explorer.
    • Projects -> New Repository

enter image description here

  • Under Create a new GitHub repository select Add an account under the account field to open up the sign on page for GitHub.
Stand answered 4/7, 2022 at 16:21 Comment(0)
A
1

I had same issue.

What helped was to update to latest VS 2022 and run Credential Manager and remove some of the old passwords (I deleted some pass from windows and web credentials, dont know which helped).

See: https://developercommunity.visualstudio.com/t/Problem-adding-Github-Account/10416187

Amylopectin answered 24/8, 2023 at 18:31 Comment(2)
That did the job for me many thanks !Luminosity
This is what worked for me in the end, clearing out the Windows Credential Store.Chaps
N
1

I had to update Visual Studio 2022 to the newest version (Version 17.9.6) via Visual Studio Installer so then adding github account (File -> Account Settings) worked. Previously I had some 17.8.x version. Hope it helps someone

Nevillenevin answered 12/4 at 5:47 Comment(0)
C
0

I changed my default browser to Edge (from Chrome) and it worked for me then.

Crawly answered 28/8, 2023 at 14:17 Comment(0)
P
0

Don't forget to clear your HSTS in your browser: https://www.heelpbook.net/2022/clear-hsts-settings-cached-in-browser-chrome-brave-firefox-safari-edge/

Preemption answered 18/6 at 23:13 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Pleasantry

© 2022 - 2024 — McMap. All rights reserved.