New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
avoid duplicate nuget packages #1344
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage Information
7.0.6 / 8.0.101 / net8.0 / Windows
Description
When you install a .NET tool as a local tool, two
.nupkg
files appear in the package folder. This might be a bug in dotnet, but it would be challenging to get this fixed.The package resolver of NUKE expects to find only one package of the same version. We should change this behavior to allow multiple files of the same version and ignore the duplicates.
For example, for dotnetsay, you can find
dotnetsay.2.1.7.nupkg
anddotnetsay.nupkg
under the folder%USERPROFILE%\.nuget\packages\dotnetsay\2.1.7
.Reproduction Steps
Make sure this folder
%USERPROFILE%\.nuget\packages\swashbuckle.aspnetcore.cli\6.5.0
doesn't exist.dotnet new tool-manifest
dotnet tool install --version 6.5.0 Swashbuckle.AspNetCore.Cli
The package was downloaded to the folder
%USERPROFILE%\.nuget\packages\swashbuckle.aspnetcore.cli\6.5.0
, and the two filesswashbuckle.aspnetcore.cli.6.5.0.nupkg
andSwashbuckle.AspNetCore.Cli.nupkg
appear in this folder.Expected Behavior
Nuke should ignore the file
Swashbuckle.AspNetCore.Cli.nupkg
, as it is a copy ofswashbuckle.aspnetcore.cli.6.5.0.nupkg
.Actual Behavior
Nuke throws an exception "Package 'Swashbuckle.AspNetCore.Cli' is referenced with multiple versions. Use NuGetPackageResolver and SetToolPath." with inner exception "Sequence contains more than one matching element".
Regression?
I don't think this case was handled before.
Known Workarounds
I will attach a pull request, as there is no possible workaround.
Could you help with a pull-request?
Yes
The text was updated successfully, but these errors were encountered: