| title | NuGet Warning NU1509 | |
|---|---|---|
| description | NU1509 warning code | |
| author | nkolev92 | |
| ms.author | nikolev | |
| ms.date | 02/04/2025 | |
| ms.topic | reference | |
| f1_keywords |
|
Duplicate 'PrunePackageReference' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. The duplicate 'PrunePackageReference' items are: X 1.0.0, X 2.0.0.
Sometimes when adding PrunePackageReference items, you may end up adding an item for a particular package multiple times.
MSBuild projects commonly import multiple .props and .targets files, so the duplicates might not be in the same file, but may be in imported files, such as Directory.Build.props, Directory.Packages.props, or Directory.Build.targets.
The .NET SDK provides a of list PrunePackageReference, so the conflict may be happening because you have specified a PrunePackageReference or due to a bug with the .NET SDK.
Remove the duplicate item, so that it's included exactly once.