You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 and dotnetsay.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 files swashbuckle.aspnetcore.cli.6.5.0.nupkg and Swashbuckle.AspNetCore.Cli.nupkg appear in this folder.
Expected Behavior
Nuke should ignore the file Swashbuckle.AspNetCore.Cli.nupkg, as it is a copy of swashbuckle.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:
Actually, just calling NuGetPackageResolver.GetLocalInstalledPackages(NuGetToolPathResolver.NuGetAssetsConfigFile).ToList() is enough to trigger an exception because the .SingleOrDefault() has multiple matching items in my current .net 8 solution:
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: