【问题标题】:VSO Build not able to download packagesVSO Build 无法下载软件包
【发布时间】:2017-01-26 12:59:50
【问题描述】:

我有以下 nuget.config 文件,下面是文件内容

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <config>
        <add key="repositoryPath" value="Packages" />
    </config>
    <packageRestore>
        <add key="enabled" value="True" />
    </packageRestore>
    <packageSources>
        <!-- Ditch all the Global NuGet package sources we only want a 
         single private NuGet repo for this project -->
        <clear />
        <add key="private="private" />
        <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
    </packageSources>
    <disabledPackageSources>
        <add key="nuget.org" value="false" />
    </disabledPackageSources>
</configuration>

私人提要中存在的所有包都已恢复,但 nuget.org 中的包没有发生同样的情况:

来自 VSO 构建输出

使用的饲料:

C:\Users\buildguest\AppData\Local\NuGet\Cache

私人的

https://www.nuget.org/api/v2/

...

正在恢复 NuGet 包 AutoMapper.5.2.0。

警告:找不到包“AutoMapper”的“5.2.0”版本。

这发生在 VSO 中的 NuGet 还原步骤期间。

【问题讨论】:

  • 我不知道您是否只是在问题文本中输入错误,或者文件的实际内容是否与您输入的完全相同,但这是不正确的:&lt;add key="private="private" /&gt;。跨度>

标签: nuget azure-devops


【解决方案1】:

将 NuGet.Protocol.Core.v3 提要协议与

结合使用
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />

而不是

<add key="nuget.org" value="https://nuget.org/api/v2/" />

【讨论】:

    【解决方案2】:

    enter image description here 在 Nuget.config 里面放下面的代码。

      <configuration>
          <packageRestore>
            <add key="enabled" value="True"/>
            <add key="automatic" value="True"/>
            </packageRestore>
        </configuration>
    

    【讨论】:

      猜你喜欢
      • 2020-07-09
      • 2015-02-28
      • 1970-01-01
      • 1970-01-01
      • 2013-11-30
      • 2022-10-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多