Skip to content
Latchkey

NuGet "NU1010: The PackageReference items ... have no version" (CPM)

Under Central Package Management every referenced package must have a matching PackageVersion in Directory.Packages.props. NU1010 fires when a project references a package that has no central version to resolve.

What this error means

Restore fails with NU1010 naming the packages that lack a PackageVersion. It is the mirror image of NU1008 - there the version is in the wrong place, here it is missing entirely. It reproduces deterministically.

dotnet restore output
error NU1010: The PackageReference items Serilog, Polly do not have corresponding
PackageVersion items defined in the Directory.Packages.props.

Common causes

A new PackageReference was added without a central version

Someone added <PackageReference Include="Polly" /> to a project under CPM but never added the matching <PackageVersion Include="Polly" ... />, so restore has no version to use.

The Directory.Packages.props is not in scope

If the props file lives in a directory that does not parent the project, MSBuild never imports it and every package looks version-less.

How to fix it

Add the missing PackageVersion centrally

Declare a version for every package the solution references.

Directory.Packages.props
<!-- Directory.Packages.props -->
<ItemGroup>
  <PackageVersion Include="Serilog" Version="4.1.0" />
  <PackageVersion Include="Polly" Version="8.3.0" />
</ItemGroup>

Confirm the props file is in scope

  1. Place Directory.Packages.props at or above the solution root so it parents every project.
  2. Run dotnet build -bl and inspect the binlog to confirm the props file is imported.
  3. Re-run restore and verify every reference now resolves a central version.

How to prevent it

  • Add a PackageVersion whenever you add a new PackageReference under CPM.
  • Keep Directory.Packages.props at the repo root so it covers all projects.
  • Review the props file in PRs that introduce new dependencies.

Frequently asked questions

What causes ""NU1010: ... no corresponding PackageVersion""?
Someone added <PackageReference Include="Polly" /> to a project under CPM but never added the matching <PackageVersion Include="Polly" ... />, so restore has no version to use.
How do I fix "NU1010: ... no corresponding PackageVersion"?
Declare a version for every package the solution references.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card