In Azure we have an pipeline which restores the nuget-packages of our C#-solution:
- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: '$(solution)'
feedsToUse: 'select'
vstsFeed: 'xxxxxxxxxxxxxxx'
includeNuGetOrg: true
The pipeline has always run smoothly so far. One day, however, we get the following error messages in the console:
##[error]The nuget command failed with exit code(null) and error()
##[error]Packages failed to restore
- There are no further error messages in the console to give us an indication of the cause.
- We use no caching.
- Locally, in Visual Studio, the restore-command works well.
Has anyone an idea what´s wrong?
2
Answers
It seems the latest version of nugetCommand2 is broken – have seen a github thread for it
revert your command to the latest working version – for us its – 2.238.1
so your command would be
There is a GitHub issue has reported the same problem occurs on the latest version (
2.244.1
) ofNuGetCommand
task. Looks like, there is defect on the task version2.244.1
.As mentioned in the GitHub issue, you can force specify the task to a previous version that can work fine. For example.