diff --git a/build/Extensions.cs b/build/Extensions.cs index bf1c09c..0a451ec 100644 --- a/build/Extensions.cs +++ b/build/Extensions.cs @@ -171,7 +171,7 @@ public static async Task InstallDotNetSdk(this NukeBuild _, params string[] vers foreach (var version in versionsToInstall.Select(arr => $"{arr[0]}.{arr[1]}.{arr[2].ToString().First().ToString()}xx").ToArray()) { - var v = version.Split('.').Select(int.Parse).ToArray(); + var v = version.Split('.').Take(2).Select(int.Parse).ToArray(); if (v?[0] < 5) { // Handle versions less than .Net 5.0 as only accepting 2 digits diff --git a/src/CP.Nuke.BuildTools/Extensions.cs b/src/CP.Nuke.BuildTools/Extensions.cs index 770a97e..5a6140d 100644 --- a/src/CP.Nuke.BuildTools/Extensions.cs +++ b/src/CP.Nuke.BuildTools/Extensions.cs @@ -171,7 +171,7 @@ public static async Task InstallDotNetSdk(this NukeBuild _, params string[] vers foreach (var version in versionsToInstall.Select(arr => $"{arr[0]}.{arr[1]}.{arr[2].ToString().First().ToString()}xx").ToArray()) { - var v = version.Split('.').Select(int.Parse).ToArray(); + var v = version.Split('.').Take(2).Select(int.Parse).ToArray(); if (v?[0] < 5) { // Handle versions less than .Net 5.0 as only accepting 2 digits