Private NuGet Feed - Remembering Password

无人久伴 提交于 2021-02-07 08:28:46

问题


Whenever I update my NuGet packages in Visual Studio, I am prompted for a username and password regarding a private NuGet feed.

Despite me ticking the box [✓] Remember my password, I am prompted to enter password on subsequent NuGet updates.

How can I make it remember my password properly?


回答1:


This is a prompt from Visual Studio and not NuGet. Information entered here is not saved with NuGet. Although it should be cached for the current Visual Studio session.

NuGet stores user names and passwords in its NuGet.Config file. You can save usernames and passwords for protected feeds by adding them to the NuGet.Config file using the nuget.exe command line.

NuGet.exe Sources Update -Name <feedName> -Source <pathToPackageSource> -UserName xxx -Password <secret>

If this is a prompt for a proxy then you can either set it using nuget:

NuGet.exe config -Set HTTP_PROXY=http://127.0.0.1 -Set HTTP_PROXY.USER=domain\user

Or use an environment variable http_proxy with the value specified in the format http://[username]:[password]@proxy.com



来源:https://stackoverflow.com/questions/35938986/private-nuget-feed-remembering-password

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!