diff --git a/Source/Tools/Flax.Build/Build/DotNet/DotNetSdk.cs b/Source/Tools/Flax.Build/Build/DotNet/DotNetSdk.cs index b32529404..0e200ea39 100644 --- a/Source/Tools/Flax.Build/Build/DotNet/DotNetSdk.cs +++ b/Source/Tools/Flax.Build/Build/DotNet/DotNetSdk.cs @@ -269,8 +269,9 @@ namespace Flax.Build dotnetSdkVersions = MergeVersions(dotnetSdkVersions, GetVersions(Path.Combine(dotnetPath, "sdk"))); dotnetRuntimeVersions = MergeVersions(dotnetRuntimeVersions, GetVersions(Path.Combine(dotnetPath, "shared", "Microsoft.NETCore.App"))); - dotnetSdkVersions = dotnetSdkVersions.Where(x => IsValidVersion(Path.Combine(dotnetPath, "sdk", x))); - dotnetRuntimeVersions = dotnetRuntimeVersions.Where(x => IsValidVersion(Path.Combine(dotnetPath, "shared", "Microsoft.NETCore.App", x))); + dotnetSdkVersions = dotnetSdkVersions.Where(x => File.Exists(Path.Combine(dotnetPath, "sdk", x, ".version"))); + dotnetRuntimeVersions = dotnetRuntimeVersions.Where(x => File.Exists(Path.Combine(dotnetPath, "shared", "Microsoft.NETCore.App", x, ".version"))); + dotnetRuntimeVersions = dotnetRuntimeVersions.Where(x => Directory.Exists(Path.Combine(dotnetPath, "packs", "Microsoft.NETCore.App.Ref", x))); dotnetSdkVersions = dotnetSdkVersions.OrderByDescending(ParseVersion); dotnetRuntimeVersions = dotnetRuntimeVersions.OrderByDescending(ParseVersion); @@ -543,11 +544,6 @@ namespace Flax.Build return null; } - private static bool IsValidVersion(string versionPath) - { - return File.Exists(Path.Combine(versionPath, ".version")); - } - private static string SearchForDotnetLocationLinux() { if (File.Exists("/etc/dotnet/install_location")) // Officially recommended dotnet location file