7
Microsoft Visual Studio Community 2019
Version 16.4.2

Every time, something changed in my local git repository (while solution is open), or i open another solution, or at random point of time Visual Studio asks me for login, i'm entering correct login pass, and VS asks for login again after 20 secods. The process repeats endlessly.

How to avoid this repeats for login, login just once and work for a log time?

tried this, but it doesn't help https://developercommunity.visualstudio.com/t/caught-in-a-login-loop/107160

Maxim Kitsenko
  • 2,042
  • 1
  • 20
  • 43

4 Answers4

9

Login loop can happen if there is a Nuget package from a custom source. To verify whether this is the problem, go to

  1. Tools -> Nuget Package Manager -> Package Manager Settings -> Package Sources
  2. Copy and paste each source into a browser and inspect the result
  3. If it says something like User 'xyz' lacks permission to complete this action. you may need an Azure DevOps team to give you ReadPackages permission.

screenshot of nuget package sources

SushiGuy
  • 1,573
  • 17
  • 20
1

I solve the problem by using credentials not from my VisualStudio, but from azure devops, where do we keep .sln

I don't know how these things are related, but it works (may be it's related to submodules some how, since few day ago we swtiched authentication for the from ssh to https. Another guess that it's because some of nuget packages are stored in feed and nuget tries to update packages source in a background.

UPDATE Yes, the problem was related to the fact .sln used nuget packages from feed, to access them you need to authorize

Maxim Kitsenko
  • 2,042
  • 1
  • 20
  • 43
0

In my case, I needed to log in to the source location from my browser.

I don't know why it works, but it does, the code is hosted in azure-devops.

Andras
  • 43
  • 6
-1

You can disable git integrations from VSCode see Remove git integrations from VSCode

or you can use ssh key see https://learn.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure-devops

Moshe Fortgang
  • 711
  • 4
  • 18