【问题标题】:dotnet restore NuGet.Config environment variables for ClearTextPassword doesn't workClearTextPassword 的 dotnet restore NuGet.Config 环境变量不起作用
【发布时间】:2017-07-06 19:18:25
【问题描述】:

要执行 CI,我想使用我自己的 nuget 提要(VSTS 提要)检查 NuGet.Config 文件。像这样:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="myfeed" value="https://xxx.pkgs.visualstudio.com/_packaging/myfeed/nuget/v3/index.json" />
  </packageSources>
  <packageSourceCredentials>
    <myfeed>
        <add key="ClearTextPassword" value="%PASSWD%" />
    </myfeed>
  </packageSourceCredentials>
</configuration>

因为我不想检查密码,所以我读到您可以在此配置中使用环境变量。我试过了,它适用于 PackageSources 值。但它似乎在 PackageSourceCredentials 中不起作用,如上所示。 有人对此有解决方案吗?

【问题讨论】:

    标签: .net-core nuget-package-restore


    【解决方案1】:

    我必须将密钥用户名添加到PackageSourceCredentials。我以为没有用。但它在我第一次删除它时缓存了,后来我添加了env var,之后它就坏了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-13
      • 2020-11-25
      • 1970-01-01
      • 1970-01-01
      • 2018-10-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多