.net core 重试';FindPackagesByIdAsync';来源

.net core 重试';FindPackagesByIdAsync';来源,.net-core,azure-devops,nuget-package-restore,build-pipeline,.net Core,Azure Devops,Nuget Package Restore,Build Pipeline,我有一个dotnetcore项目,它在本地构建得很好,但多次抛出以下错误: Retrying 'FindPackagesByIdAsync' for source 'https://mycontrol.pkgs.visualstudio.com/_packaging/f8292c33-blah-blah-blah-e5e14bb9ba87/nuget/v3/flat2/microsoft.net.test.sdk/index.json'. Response status code does

我有一个
dotnetcore
项目,它在本地构建得很好,但多次抛出以下错误:

Retrying 'FindPackagesByIdAsync' for source 'https://mycontrol.pkgs.visualstudio.com/_packaging/f8292c33-blah-blah-blah-e5e14bb9ba87/nuget/v3/flat2/microsoft.net.test.sdk/index.json'.
  Response status code does not indicate success: 401 (Unauthorized).
此错误出现在项目中使用的每个包的VSTS生成日志中

打开链接会显示以下内容:

{
$id: "1",
innerException: null,
message: "Can't find the package 'microsoft.net.test.sdk' in feed 'MyFeeds'.",
typeName: "Microsoft.VisualStudio.Services.NuGet.WebApi.Exceptions.PackageNotFoundException, Microsoft.VisualStudio.Services.NuGet.WebApi",
typeKey: "PackageNotFoundException",
errorCode: 0,
eventId: 3000
}
虽然我在项目文件夹中没有
NuGet.Config
,但在父文件夹中有一个:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="_nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="_myget.org" value="https://dotnet.myget.org/F/mstestv2/api/v3/index.json" />
  </packageSources>
</configuration>
如果一个应用程序的所有错误都是第一个错误,那么构建就会成功,但是如果第二个错误中有一个或多个错误,那么构建就会失败

我需要做什么才能告诉
dotnet core
软件包的来源

[EDIT]我尝试将
NuGet.Config
放在项目文件夹中,但没有成功


[EDIT-2]我已经让它工作了。解决方案是将
NuGet
源文件放入
csproj
文件中,如下所述:

在构建管道之前,您是否使用dotnet还原任务还原NuGet包?如果是,请将您的dotnet还原任务构建管道定义共享给我们好吗?再次,恕我直言,
.NET SDK 2.1.500
上存在问题,不确定是否将其修复为2.1.701,作为解决方法,您可以尝试在nuget.config中添加Microsoft Visual Studio Offline Packages包源代码,以检查它是否适用于您:生成管道确实在powershell脚本中使用了还原任务,但我认为我无法共享该脚本。我需要检查SDK版本,但我根本没有时间。我会在可能的时候给你回电话。感谢您提供的信息。“使用.NET Core”步骤配置为安装版本“2.1.x”,PS脚本只需在特定csproj文件上执行点网还原。由于管道正在工作,我不会添加脱机包,除非它再次中断。谢谢你的建议。
C:\hostedtoolcache\windows\dotnet\sdk\2.1.701\NuGet.targets(121,5): error : Failed to retrieve information about 'specflow' from remote source 'https://apsourcecontrol.pkgs.visualstudio.com/_packaging/98e0f10f-afcb-4c74-a075-37c564e0408a/nuget/v3/flat2/specflow/index.json'. [D:\a\1\s\Testing\Tester\MsTester\MsTester.csproj]
C:\hostedtoolcache\windows\dotnet\sdk\2.1.701\NuGet.targets(121,5): error :   Response status code does not indicate success: 401 (Unauthorized). [D:\a\1\s\Testing\Tester\MsTester\MsTester.csproj]