Azure 管道和 DotNet 核心项目:无法加载源 api.nuget.org 的服务索引

Azure pipeline and DotNet core project: Unable to load the service index for source api.nuget.org

我的任务是在 Windows 自托管代理上创建管道,以构建位于 GitHub 的 DotNet 核心项目。

我有一个管道已经可以做到这一点并且运行良好,但是在第二个项目中使用它时失败并显示以下消息:

Determining projects to restore... 
C:\Program Files\dotnet\sdk.0.100\NuGet.targets(131,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [E:\Agent\_work\s\src\myProject\ myProject.csproj] 
C:\Program Files\dotnet\sdk.0.100\NuGet.targets(131,5): error : Response status code does not indicate success: 302 (Moved Temporarily). [E:\Agent\_work\s\src\ myProject \ myProject.csproj] 
##[error]Cmd.exe exited with code '1'. 

我们有防火墙限制,所以我们设置了一个带有上游源代码的工件提要到 Nuget,我无法确定有效的项目是否尝试使用它,但至少它不会失败。我不是项目的作者,也不经常使用 Nuget,我可以帮忙找出问题所在吗?它会被埋在项目的 Nuget 文件中吗?

好的,我在解决方案中添加了一个 nuget.config 文件,其中包含我的上游提要的路径:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="REPO" value="https://...com//_packaging/REPO/nuget/v3/index.json" />
  </packageSources>
</configuration>

在我的 YAML 中只使用了这个:

- task: NuGetAuthenticate@0
  displayName: 'Step 1: Authenticate with NuGet'