From 3186af87e7395097aa508c5f3520c305d2b967fe Mon Sep 17 00:00:00 2001 From: Bernhard Richter Date: Mon, 16 Mar 2020 11:12:45 +0100 Subject: [PATCH] Order latest version by NuGet version --- src/Dotnet.Deps.Core/NuGet/ILatestVersionProvider.cs | 4 ++-- src/Dotnet.Deps/Dotnet.Deps.csproj | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Dotnet.Deps.Core/NuGet/ILatestVersionProvider.cs b/src/Dotnet.Deps.Core/NuGet/ILatestVersionProvider.cs index c08f399..3cb3639 100644 --- a/src/Dotnet.Deps.Core/NuGet/ILatestVersionProvider.cs +++ b/src/Dotnet.Deps.Core/NuGet/ILatestVersionProvider.cs @@ -87,11 +87,11 @@ private async Task GetLatestVersion(string packageName, bool preRelease, SourceR if (preRelease) { - latestVersionInRepository = allVersions.LastOrDefault(); + latestVersionInRepository = allVersions.OrderBy(nv => nv).LastOrDefault(); } else { - latestVersionInRepository = allVersions.Where(v => !v.IsPrerelease).LastOrDefault(); + latestVersionInRepository = allVersions.Where(v => !v.IsPrerelease).OrderBy(nv => nv).LastOrDefault(); } if (latestVersionInRepository != null) diff --git a/src/Dotnet.Deps/Dotnet.Deps.csproj b/src/Dotnet.Deps/Dotnet.Deps.csproj index e00b5ce..e611d57 100644 --- a/src/Dotnet.Deps/Dotnet.Deps.csproj +++ b/src/Dotnet.Deps/Dotnet.Deps.csproj @@ -15,7 +15,7 @@ MIT git https://github.com/seesharper/dotnet-deps.git - 2.0.0 + 2.0.1