Столкновение со странной проблемой в конвейере сборки в ADO для dot net core service .
Я пытаюсь указать путь для пакетов, на которые ссылаются в файле nuget.config. Ниже приведен файл nuget.config.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositorypath" value="..\..\Packages" />
<!--Affects projects using PackageReference only-->
<add key="globalPackagesFolder" value="..\..\Packages" />
<add key="dependencyversion" value="HighestMinor" />
</config>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageRestore>
<!-- Allow NuGet to download missing packages -->
<add key="enabled" value="True" />
<!-- Automatically check for missing packages during build in Visual Studio -->
<add key="automatic" value="True" />
</packageRestore>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<packageSources>
<add key="NuGet Server" value="my private feed" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<disabledPackageSources />
</configuration>
После добавления строки ниже получено 401 Несанкционированный.
<add key="globalPackagesFolder" value="..\..\Packages" />
Исключение
Retrying 'FindPackagesByIdAsync' for source 'myfeed/nuget/v3/flat2/microsoft.extensions.dependencyinjection/index.json'.
Response status code does not indicate success: 401 (Unauthorized).
Restore failed in 8.09 sec for /home/vsts/work/1/s/Service/Test/myproject.Tests/myproject.Tests.csproj.
Нижетакое задачи в конвейере сборки
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
#command: 'restore'
restoreSolution: 'Service/myservice.sln'
feedsToUse: config
nugetConfigPath: 'Service/.nuget/nuget.config'
externalFeedCredentials: 'MyPackages'
- script: dotnet build "Service/myservice.sln" --configuration $(buildConfiguration) -p:langversion=latest
displayName: 'dotnet build $(buildConfiguration)'