| title | NuGet Error NU1008 | |
|---|---|---|
| description | NU1008 error code | |
| author | nkolev92 | |
| ms.author | nikolev | |
| ms.date | 11/07/2022 | |
| ms.topic | reference | |
| f1_keywords |
|
Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items: PackageId.
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" />- 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.