Skip to content

Commit e2f0d89

Browse files
committed
cleanup
1 parent f8424de commit e2f0d89

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

src/NuGet.Core/NuGet.Common/RuntimeEnvironmentHelper.cs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,7 @@ public static bool IsWindows
4040

4141
private static bool GetIsWindows()
4242
{
43-
#if IS_CORECLR
44-
// This API does work on full framework but it requires a newer nuget client (RID aware)
45-
if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows))
46-
{
47-
return true;
48-
}
49-
50-
return false;
51-
#else
52-
var platform = (int)Environment.OSVersion.Platform;
53-
return (platform != 4) && (platform != 6) && (platform != 128);
54-
#endif
43+
return System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows);
5544
}
5645

5746
public static bool IsMono
@@ -91,7 +80,6 @@ public static bool IsMacOSX
9180

9281
private static bool GetIsMacOSX()
9382
{
94-
// RuntimeInformation.IsOSPlatform is available on .NET Framework 4.7.1+ and .NET Core
9583
return System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.OSX);
9684
}
9785

@@ -102,7 +90,6 @@ public static bool IsLinux
10290

10391
private static bool GetIsLinux()
10492
{
105-
#if IS_CORECLR
10693
// This API does work on full framework but it requires a newer nuget client (RID aware)
10794
if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux))
10895
{
@@ -117,10 +104,6 @@ private static bool GetIsLinux()
117104
}
118105

119106
return false;
120-
#else
121-
var platform = (int)Environment.OSVersion.Platform;
122-
return platform == 4;
123-
#endif
124107
}
125108
}
126109
}

0 commit comments

Comments
 (0)