私有 NuGet 提要 - 记住密码 [英] Private NuGet Feed - Remembering Password

查看:72
本文介绍了私有 NuGet 提要 - 记住密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我在 Visual Studio 中更新 NuGet 包时,系统都会提示我输入有关私有 NuGet 源的用户名和密码.

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

尽管我勾选了[✓] 记住我的密码,但在后续 NuGet 更新时仍会提示我输入密码.

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?

推荐答案

这是来自 Visual Studio 而不是 NuGet 的提示.此处输入的信息不会与 NuGet 一起保存.虽然它应该为当前的 Visual Studio 会话缓存.

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 将用户名和密码存储在其 NuGet.Config 文件中.您可以通过使用 nuget 将用户名和密码添加到 NuGet.Config 文件来保存受保护提要的用户名和密码.exe 命令行.

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>

如果这是代理的提示,那么您可以使用 nuget 进行设置:

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

或者使用环境变量 http_proxy,其值的格式为 http://[username]:[password]@proxy.com

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

这篇关于私有 NuGet 提要 - 记住密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆