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.
myfeed/nuget/v3/index.js
? Is the path of your private Azure Artifacts feed? It should be aindex.json
file instead ofindex.js
file. If possible, please double check the path. – Leo Liu-MSFT