Fixing Visual Studio Continuously Prompting for Credentials

Sometimes I find a solution to problems I stumble upon infrequently - this means that next time I have the same problem enough time has passed so that I can no longer remember the solution to the problem. In these cases I find it very helpful to be able to look up in my on blog for the solution. This post is one of these cases... 😀

Every once in a while Visual Studio falls into an authorization loop where it keeps asking for my credentials. The root cause to the problem seems to be that I have some private nuget feeds and multiple Azure Active Directory accounts connected to my VS.

When I connect these accounts and setup the Nuget feeds Visual Studio will start prompting for my credentials everytime I restart VS and build the project. This is quite annoying but luckily there's a fix to this:

  1. Close all Visual Studio instances
  2. Delete the folder and all it's content: %localappdata%.IdentityService
  3. Start Visual Studio
  4. Build the project, when prompted for credentials, enter them, one last time
  5. Restart Visual Studio, build the project and verify that you don't need to re-enter credentials anymore.