I have a .NET solution which needs packages from 3 sources:
I have a nuget.config file with the following:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="MyOrga" value="..." />
<add key="TheOtherFeed" value="..." />
</packageSources>
</configuration>
I have, in my projects, a reference to the package MyPackage
which is in MyOrga
, and to the package MyOtherPackage
, which is in TheOtherFeed
.
In my Azure DevOps pipeline, during the Nuget Restore task, it successfully finds the nuget.config and finds the 3 feeds. However, I get this error, which makes my task fail:
##[error]The nuget command failed with exit code(1) and error(NU1301: Failed to retrieve information about 'MyPackage' from remote source '<TheOtherFeed>/MyPackage/index.json'.
So it's basically only trying to get the package from the wrong feed, even though it found all 3 feeds (including the correct one). What did I do wrong?
You can get that error if your feed is not authenticated. Try adding a NuGetAuthenticate:
- task: NuGetAuthenticate@1
before you restore.