VSTS无法加载源401的服务索引

问题描述 投票:2回答:1

我知道关于同一签名的其他帖子。通过他们之后我仍然无法解决我的问题。

我的团队使用VSTS的构建定义进行持续集成。 enter image description here

此构建定义在最新的pull请求之前正常工作。我在Nuget Restore期间遇到了错误信息

2018-06-20T00:37:27.6438127Z System.AggregateException:发生一个或多个错误。 ---> NuGet.Protocol.Core.Types.FatalProtocolException:无法加载源https://microsoft.pkgs.visualstudio.com/_packaging/CBT/nuget/v3/index.json的服务索引。 ---> System.Net.Http.HttpRequestException:响应状态代码不表示成功:401(未授权)。

我在nuget.config中有https://microsoft.pkgs.visualstudio.com/_packaging/CBT/nuget/v3/index.json,并且在失败的PR中nuget.config中没有任何改变

我可以使用VS2017在本地计算机上成功恢复并构建整个解决方案。 PR中唯一相关的变化是,它使用packagereference来获取nuget包,而不是使用package.config。我试图回到使用package.config,构建仍然会失败并出现相同的错误消息。

提前致谢。

c# nuget azure-devops azure-pipelines nuget-package-restore
1个回答
0
投票

您可以使用指定的qazxsw poi文件中的凭据(PAT或备用凭证)更新VSTS订阅源。

如:

nuget.config

然后,您可以提交nuget sources update -Name "vstsfeed" -Source https://microsoft.pkgs.visualstudio.com/_packaging/CBT/nuget/v3/index.json -Username "Alternate username" -Password "alternate password" -configfile /path/to/nuget.config 文件的更改并推送到VSTS repo。并再次构建以检查它是否有效。

© www.soinside.com 2019 - 2024. All rights reserved.