Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/Tests/Microsoft.NET.TestFramework/EnvironmentInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ public static bool SupportsTargetFramework(string targetFramework)
{
string restOfRid = currentRid.Substring(ridOS.Length + 1);
string ubuntuVersionString = restOfRid.Split('-')[0];
if (float.TryParse(ubuntuVersionString, out float ubuntuVersion))
if (float.TryParse(ubuntuVersionString, System.Globalization.CultureInfo.InvariantCulture, out float ubuntuVersion))
{
if (ubuntuVersion > 16.04)
if (ubuntuVersion > 16.04f)
{
if (nugetFramework.Version < new Version(2, 0, 0, 0))
{
Expand All @@ -144,27 +144,25 @@ public static bool SupportsTargetFramework(string targetFramework)
{
string restOfRid = currentRid.Substring(ridOS.Length + 1);
string osxVersionString = restOfRid.Split('-')[0];
// From a string such as "10.14", get the second part, e.g. "14"
string osxVersionString2 = osxVersionString.Split('.')[1];
if (int.TryParse(osxVersionString2, out int osxVersion))
if (float.TryParse(osxVersionString, System.Globalization.CultureInfo.InvariantCulture, out float osxVersion))
{
// .NET Core 1.1 - 10.11, 10.12
// .NET Core 2.0 - 10.12+
if (osxVersion <= 11)
if (osxVersion <= 10.11f)
{
if (nugetFramework.Version >= new Version(2, 0, 0, 0))
{
return false;
}
}
else if (osxVersion == 12)
else if (osxVersion == 10.12f)
{
if (nugetFramework.Version < new Version(2, 0, 0, 0))
{
return false;
}
}
else if (osxVersion > 12)
else if (osxVersion > 10.12f)
{
// .NET Core 2.0 is out of support, and doesn't seem to work with OS X 10.14
// (it finds no assets for the RID), even though the support page says "10.12+"
Expand Down