Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1.2 KB

File metadata and controls

45 lines (33 loc) · 1.2 KB
title description author ms.author ms.date ms.topic f1_keywords
NuGet Error NU1008
NU1008 error code
nkolev92
nikolev
11/07/2022
reference
NU1008

NuGet Error NU1008

Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items: PackageId.

Issue

When using central package management, versions must be defined on the PackageVersion item.

In your project file, you may see:

<!-- In the project file. -->
<PackageReference Include="PackageId" Version="5.1.0" />

Solution

  • Remove the version from the PackageId PackageReference.
  • You may need to add or update the PackageVersion item for PackageId in Directory.Packages.props

Example:

<!-- In the project file. -->
<PackageReference Include="PackageId" />
<!-- In the Directory.Packages.props -->
<PackageVersion Include="PackageId" Version="5.1.0" />

Note

Note that metadata such as IncludeAssets, PrivateAssets etc. should remain on the PackageReference item.