| title | NuGet Warning NU1505 | |
|---|---|---|
| description | NU1505 warning code | |
| author | nkolev92 | |
| ms.author | nikolev | |
| ms.date | 03/31/2022 | |
| ms.topic | reference | |
| f1_keywords |
|
Duplicate 'PackageDownload' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. The duplicate 'PackageDownload' items are: X [1.0.0], X [2.0.0].
Sometimes when adding PackageDownload items, you may end up adding an item for a particular package multiple times.
Example:
<ItemGroup>
<PackageDownload Include="X" Version="[1.0.0]" />
</ItemGroup>
...
<!-- Somewhere else in the project file, or another MSBuild file-->
<ItemGroup>
<PackageDownload Include="X" Version="[2.0.0]" />
</ItemGroup>This can cause an inconsistent restore behavior.
Consult the recommendations in the warning message and do one of the following:
- Remove the duplicate items
- Use item
Updateinstead of itemInclude