When I try to restore packages from a private feed it seems to just ignore the feed and only look for dependencies in nuget.org.
I have a nuget authenticate that provides credentials for the feeds I wish to use.
This is how my task looks like:
- task: DotNetCoreCLI@2
inputs:
command: ‘custom’
custom: ‘restore’
projects: ‘my project.csproj’
arguments: —-force -v:n
feedsToUse: ‘select’
vstsFeed: ‘myfeedurl’
includeNuGetOrg: true
In the feeds used output it only shows the NuGet org feed and what’s strange is that this only broke recently, it was restoring fine a week ago.
Any help would be appreciated.
Things I’ve tried:
- Adding the name of the artifact feed.
- Nugetcommand
- nuget config (this works but I’d like to avoid using a nuget config)
- Adding the feed to the build agent
I was having similar issue trying to publish a Nuget Artifact in Azure Devops and had to add the same restore task. The code below worked for me when running before the "nuget pack" task. You can hardcode parameter values to suit you but they are passed in from parent in below example.
This may not be the best solution but also something you can try if you are using Azure Pipelines is to click on the "Settings" hyperlink on the Edit UI and it should allow you to select a feed from your project granted correct permissions are in place.
<FEED_GUID> is a placeholder for the GUID of our private Nuget feed.
Using Azure DevOps UI:
I hope this helps. Good luck!