From 774234d0c37a101d9b55a97a142eb87cf897e467 Mon Sep 17 00:00:00 2001 From: annie <59816815+JL03-Yue@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:17:37 -0800 Subject: [PATCH] add situation with no version specified --- .../dotnet/NugetPackageDownloader/NuGetPackageDownloader.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Cli/dotnet/NugetPackageDownloader/NuGetPackageDownloader.cs b/src/Cli/dotnet/NugetPackageDownloader/NuGetPackageDownloader.cs index 4246d3119333..67645e318a16 100644 --- a/src/Cli/dotnet/NugetPackageDownloader/NuGetPackageDownloader.cs +++ b/src/Cli/dotnet/NugetPackageDownloader/NuGetPackageDownloader.cs @@ -459,7 +459,11 @@ await Task.WhenAll( private string GenerateVersionRangeErrorDescription(string packageIdentifier, VersionRange versionRange) { - if(versionRange.HasLowerAndUpperBounds && versionRange.MinVersion == versionRange.MaxVersion) + if (!string.IsNullOrEmpty(versionRange.OriginalString) && versionRange.OriginalString == "*") + { + return $"{packageIdentifier}"; + } + else if(versionRange.HasLowerAndUpperBounds && versionRange.MinVersion == versionRange.MaxVersion) { return $"Version {versionRange.MinVersion} of package {packageIdentifier}"; }