Potential solutions

Visual Studio's NuGet client is notoriously bad at remembering credentials, even when you tell it to remember credentials. That said, the above approach should work.

  1. Try restarting Visual Studio. It does not always auto-refresh NuGet.config automatically and an IDE restart is a good approach of resolving that.
  2. If [YourPackageSourceName] contains any non-alphanumeric characters, some versions of the NuGet client in Visual Studio will ignore it.
  3. Remember that NuGet only uses username/password for authentication while searching and installing packages. If you have used a similar command as the above but only stored the API key, the client will not have enough information to authenticate against your feed.
  4. If documentation says "username", we do really mean username. An e-mail address on MyGet is never a valid username.
  5. In Visual Studio 2017, you could check our credential provider instead to make authentication in Visual Studio easier.
Did this answer your question?