DEV Community

S8ui
S8ui

Posted on

NuGet Restore Failing with 'Unable to find version' Package? Check Your NuGetToolInstaller Version!

The Problem

In one of our Azure DevOps pipelines, nuget restore suddenly started failing with an error stating, in essence, that the requested package could not be found in the referenced version. The task referencing the package hadn't changed — yet the restore stage kept failing.

At first glance, this looks like an issue with the package source, some caching effect, or a broken .nuspec/lockfile. It wasn't.

The Root Cause

The actual culprit was the version of the NuGetToolInstaller@1 task itself. The pipeline had NuGet pinned to version 6.12.2.

The Fix

Bump the versionSpec in the NuGetToolInstaller@1 task from 6.12.2 to 7.9.0:

  - task: NuGetToolInstaller@1
    displayName: 'Use NuGet 7.9.0'
    inputs:
      versionSpec: 7.9.0
      checkLatest: false
Enter fullscreen mode Exit fullscreen mode

That's it. After the update, nuget restore ran through cleanly again.

Top comments (0)