FSharp.Data icon indicating copy to clipboard operation
FSharp.Data copied to clipboard

FSharp.Data.Core.Tests.CSharp.csproj: [NU1504] Duplicate 'PackageReference' items found.

Open gustav21 opened this issue 2 years ago • 2 comments

I have the following compilation error:

FSharp.Data.Core.Tests.CSharp.csproj: [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: Microsoft.NET.Test.Sdk 16.9.1, Microsoft.NET.Test.Sdk 17.3; NUnit3TestAdapter 3.17.0, NUnit3TestAdapter 4.2.1; NUnit 3.13.1, NUnit 3.13.1.

I can add NoWarn, but didn't anyone else have the same? Or did everyone added NoWarn, but don't commit? )

gustav21 avatar Aug 24 '22 16:08 gustav21

NuGet turned on this warning by default some time ago. It is safe to ignore it in this case. However, it seems paket is adding reference (via Paket targets file, which is included in tests csproj), and later on they're again added in csproj.

<ItemGroup>
	  <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
	  <PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
	  <PackageReference Include="NUnit" Version="3.13.1" />
</ItemGroup>

vzarytovskii avatar Aug 29 '22 16:08 vzarytovskii

See also: https://github.com/dotnet/sdk/issues/24747#issuecomment-1126298533

CaptnCodr avatar Sep 02 '22 06:09 CaptnCodr