Nuget私包源记住用户名和密码

在用 Visual Studio 打开新项目时,每次都弹出输入Nuget私包源的用户名和密码,勾选了记住密码也没用。

解决方法:
1、打开cmd
2、输入如下命名
NuGet.exe Sources Update -Name 自定义的私包源名称 -Source 私包源地址 -UserName 用户名 -Password 密码
3、回车,可看到
Package source 包源名称 was successfully updated.

允许不安全的 HTTP(仅限可信内网)

通过 Git 配置全局允许(适用于所有仓库)
git config --global credential.allowHttpAuth true

针对特定域名允许(更安全)
git config --global credential.http://your-gitlab.local/allowHttpAuth true
替换 your-gitlab.local 为你的实际 GitLab 服务器地址(不含路径)。

允许 http nuget allowInsehcureConnections="true"

参考地址:
https://www.coder.work/article/7086640
https://stackoverflow.com/questions/35938986/private-nuget-feed-remembering-password

posted @ 2022-06-24 16:01  xingtian  阅读(1432)  评论(0)    收藏  举报