xoofx / dotnet-releaser

Easily build, run tests and coverage, cross-compile, package and publish your .NET library or application to NuGet and GitHub.
BSD 2-Clause "Simplified" License
698 stars 25 forks source link

NU1504 error on test project with coverlet.collector reference #42

Closed kashelkin closed 1 year ago

kashelkin commented 2 years ago

I have test project with coverlet.collector reference. Recently dotnet-releaser started to throw this error on [9] step:

error NU1504: Duplicate 'PackageReference' items found. 
Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. 
The duplicate 'PackageReference' items are: coverlet.collector 3.1.0, coverlet.collector 3.1.*.

It seems that it happens after new NuGet 6.3 release. They introduced new warnings for duplicate package references, versions and downloads.

I added this to my project file as workaround:

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
  <NoWarn>1504</NoWarn>
</PropertyGroup>
xoofx commented 2 years ago

Indeed, there is not many options, either: