title | description | author | ms.author | ms.date | ms.topic | f1_keywords | |
---|---|---|---|---|---|---|---|
NuGet Error NU1008 |
NU1008 error code |
nkolev92 |
nikolev |
11/07/2022 |
reference |
|
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.