Reputation: 18066
My solution contains references to some private Nuget packages in a feed hosted in a Devops Artifact.
It builds on my machine.
However the Dev ops build fails because I need to set up access to the private Nuget Feed.
I am studying the docs
I have a nuget.config file in my solution with a reference to my private feed.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<activePackageSource>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</activePackageSource>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="MyFeed" value="myfeed/nuget/v3/index.js" />
<!-- Others -->
</packageSources>
<packageSourceCredentials>
<!-- secret stuff -->
</packageSourceCredentials>
</configuration>
The NugetCommand task has an error (edited)
NU1000: Unable to find version 'myversion' of package 'MyPackageName'.
C:\Users\VssAdministrator\.nuget\packages\: Package 'MyPackageName-Version' is not found on source 'C:\Users\VssAdministrator\.nuget\packages\'.
The build pipeline has a task
- task: NuGetCommand@2
inputs:
restoreSolution: '**\*.sln'
feedsToUse: config
nugetConfigPath: 'myproject/nuget.config'
The edited error is
NU1000: Unable to find version 'myversion' of package 'mypackage'.
C:\Users\VssAdministrator\.nuget\packages\: Package 'mypackage-versionumber' is not found on source 'C:\Users\VssAdministrator\.nuget\packages\'.
myfeed/nuget/v3/index.js: The V2 feed at 'myfeed/nuget/v3/index.js/FindPackagesById()?id='mypackage'&semVerLevel=2.0.0' returned an unexpected status code '404 Not Found'.
https://api.nuget.org/v3/index.json: Package 'mypackage' is not found on source 'https://api.nuget.org/v3/index.json'.
Why would the error mention a V2 feed?
In VS2017 15.9.7 Help About, I see that NuGet Package Manager is 4.6.0
I wonder if it could be an access issue. In Devops the project containing the package feed is in the same organisation as the consuming project.
Upvotes: 0
Views: 1334
Reputation: 76760
Configure Devops to use packages from private Azure Artifacts feed
Your YAML file and configuration steps are correct. I test it on my side and it works fine, but I found that your private Nuget packages feed path does not seem to be incorrect, so confirm with you by comments.
The path should be .json
file. We could copy it from Azure Artifacts feed with connect to feed button:
Post it as answer, hope it would be helpful to anyone who encounters similar issues.
Thanks also to the confirmation of @Kirsten Greed.
Upvotes: 1