[英]TFS can not restore nuget from Tfs Packages(Azure Artifacts) in linux
I want to build my .net core application using linux's build agent. 我想使用Linux的构建代理来构建我的.net核心应用程序。 But if my nuget is hosted in tfs packages or Azure Artifacts, it can't be restored.
但是,如果我的Nuget托管在tfs程序包或Azure Artifacts中,则无法还原。
Always get an error when using the dotnet step to restore nuget 使用dotnet步骤还原nuget时总是出现错误
/usr/share/dotnet/sdk/2.2.300/NuGet.targets(121,5): error : Unable to load the service index for source http://tfsServer/ProjectCollection/_packaging/guid/nuget/v3/index.json . /usr/share/dotnet/sdk/2.2.300/NuGet.targets(121,5):错误:无法加载源http:// tfsServer / ProjectCollection / _packaging / guid / nuget / v3 / index的服务索引。 json 。
/usr/share/dotnet/sdk/2.2.300/NuGet.targets(121,5): error : Response status code does not indicate success: 401 (Unauthorized) /usr/share/dotnet/sdk/2.2.300/NuGet.targets(121,5):错误:响应状态代码未指示成功:401(未授权)
I Try: 我尝试:
Refer to the practices mentioned in https://github.com/microsoft/artifacts-credprovider to install the plugin in the linux agent and specify the environment variable VSS_NUGET_EXTERNAL_FEED_ENDPOINTS at compile time. 请参阅https://github.com/microsoft/artifacts-credprovider中提到的做法,以在Linux代理中安装插件,并在编译时指定环境变量VSS_NUGET_EXTERNAL_FEED_ENDPOINTS。 But no effect.
但是没有效果。
If you are not using nuget of tfs itself. 如果您不使用tfs本身的nuget。 A nuget built with a blank site referenced by nuget.server can be restored normally.
使用nuget.server引用的空白站点构建的nuget可以正常还原。
Tfs Server version: Tfs 2018 Update2 TFS服务器版本:TFS 2018 Update2
Build Agent Linux Server: centos 7.2 Build Agent Linux服务器:centos 7.2
Agent version: 2.131 代理版本:2.131
According to the similar error in this link: https://github.com/NuGet/Home/issues/6902 根据此链接中的类似错误: https : //github.com/NuGet/Home/issues/6902
You should be able to use a credential provider as mentioned. 您应该能够使用提到的凭证提供程序。 Please also make sure you have met all prerequisites for it
还请确保您已满足所有先决条件
Besides, your build agent version 2.131 is too old. 此外,您的构建代理版本2.131太旧。 Please upgrade azure-pipelines-agent to latest and try again.
请将azure-pipelines-agent升级到最新版本,然后重试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.