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



我的任务是在我们的Windows自托管代理上创建一个管道,以在GitHub上构建一个DotNet Core项目。

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

Determining projects to restore... 
C:Program Filesdotnetsdk5.0.100NuGet.targets(131,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [E:Agent_work24ssrcmyProject myProject.csproj] 
C:Program Filesdotnetsdk5.0.100NuGet.targets(131,5): error : Response status code does not indicate success: 302 (Moved Temporarily). [E:Agent_work24ssrc 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'

最新更新