I need to use the .NET Core
build pipeline task with the restore
command. Target is to restore the package references (*.nupkg
) of a solution. I have two package sources:
- nuget.org
- private artifacts feed (MyFeed) on ADS
Some projects in my solution refer the packages from MyFeed and needs to restored on agent before build.
The Error
The task fail when it try to download the packages from my private feed MyFeed: (unfortunately the output is on german so i put the error message into google translator and hope the best)
C:\Program Files\dotnet\sdk\3.1.402\NuGet.targets(128,5): error: Error getting information about "ext.lib.MyPackage" from the remote source "https://MyUrl.de/Collection/_packaging/38df75fe-122d-57f9-af47-de3a09231f5e/nuget/v3/flat2/ext.lib .MyPackage / index.json ".
C:\Program Files\dotnet\sdk\3.1.402\NuGet.targets (128,5): error: No login information is available in the security package. [D:\AzureDevOpsData\Agents\MyAgent\_work\2\s\MySolution.sln]
What I have done?
Use NuGet TaskI try to reproduce that behavior with the NuGet
task, but with this task everything works fine. This task has access to my private feed MyFeed. Important: the NuGet
task is no alternative for use, we need to use the .NET Core
task
I add my feed to the Package Manager in Visual Studio 2019 on my agent and enter the credentials of my agent user. In result of the an 2 entries added to my Windows Credential Manager.
This change do not solve the issue, the error message is the same.
Edit 1: add Auth to NuGet.Config
I try to add the Auth to my NuGet.Config
. This approach has many variables, I try to list all varieties I try.
NuGet.Config Path
The dotnet restore
task provides to options for a NuGet config:
- Option: I associate with the
%APPDATA%\NuGet\NuGet.Config
(but I am not sure) - Option: is a
NuGet.Config
path to your repository
So for all runs I try always BOTH options!
- Run:
Username
withDomain Password
(Encrypted) ❌ - Run:
Username
withPAT
(ClearTextPassword) ❌ - Run:
Domain\Username
withPAT
(ClearTextPassword) ❌ - Run:
Username
withDomain Passwort
(ClearTextPassword) ❌ - Run:
Domain\Username
withDomain Passwort
(ClearTextPassword) ❌
NuGet.Config structure for all runs
<?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="MyFeed" value="https://MyFeedUrl/nuget/v3/index.json" />
</packageSources>
<config>
<add key="http_proxy" value="http://www-MyProxy.de:3000" />
<add key="https_proxy" value="http://www-MyProxy.de:3000" />
</config>
<packageSourceCredentials>
<MyFeed>
<add key="Username" value="$MyRunUser" />
<add key="ClearTextPassword" value="$MyRunKey" /> <- ClearTextPassword OR Password
<add key="ValidAuthenticationTypes" value="basic" />
</MyFeed>
</packageSourceCredentials>
</configuration>
Temporary NuGet.Config
Doesn't matter what I do, the dotnet
task always create and use a temporary NuGet.Config
. From the system.deubg = true
log I could get:
##[debug]Getting credentials for local feeds
SYSTEMVSSCONNECTION exists true
##[debug]SYSTEMVSSCONNECTION exists true
##[debug]Got auth token
##[debug]externalEndpoints=null
##[debug]Setting up sources
##[debug]selectOrConfig=config
##[debug]nugetConfigPath=D:\AzureDevOpsData\Agents\MyAgent\_work\18\s\MyNuGet.Config
##[debug]check path : D:\AzureDevOpsData\Agents\MyAgent\_work\18\s\MyNuGet.Config
##[debug]nugetConfigPath=D:\AzureDevOpsData\Agents\MyAgent\_work\18\s\MyNuGet.Config
##[debug]Absolute path for pathSegments: D:\AzureDevOpsData\Agents\MyAgent\_work\18\s\MyNuGet.Config = D:\AzureDevOpsData\Agents\MyAgent\_work\18\s\MyNuGet.Config
##[debug]build.sourcesDirectory=D:\AzureDevOpsData\Agents\MyAgent\_work\18\s
##[debug]Absolute path for pathSegments: D:\AzureDevOpsData\Agents\MyAgent\_work\18\s = D:\AzureDevOpsData\Agents\MyAgent\_work\18\s
##[debug]nugetConfigPathpath supplied :true
##[debug]Agent.BuildDirectory=D:\AzureDevOpsData\Agents\MyAgent\_work\18
##[debug]build.buildId=15914
##[debug]Setting auth in the temp nuget.config
"NuGet.config" wird in einer temporären Konfigurationsdatei gespeichert.
##[debug]Getting sources from NuGet.config in this location: D:\AzureDevOpsData\Agents\MyAgent\_work\18\Nuget\tempNuGet_12914.config
Temporary NuGet.Config:
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3"/>
<add key="feed-MyFeed" value="https://MyAdsUrl.de/MyCollection/_packaging/MyFeed/nuget/v3/index.json"/></packageSources>
<config>
<add key="http_proxy" value="http://www-cache.MyProxy.de:3000"/>
<add key="https_proxy" value="http://www-cache.MyProxy.de:3000"/>
</config>
<packageSourceCredentials>
<feed-MyFeed><add key="Username" value="VssSessionToken"/><add key="ClearTextPassword" value="QhbGcsadsasadd... VERY LONG KEY-PA"/></feed-MyFeed></packageSourceCredentials>
</configuration>
From my perspective I can see the temprary Nuget.Config
contains my custom proxy and my custom feed, but not my custom authentication.
Does that mean that the dotnet
task do not use my custom NuGet.Config
?
Meta Information
- ADS and Agent is self-hosted
- Version: 17.153.29207.5 (AzureDevOps2019.Update1)
- Proxy: Yes