diff --git a/src/shared/Core/PlatformUtils.cs b/src/shared/Core/PlatformUtils.cs
index 212c13219..5d00ffcf6 100644
--- a/src/shared/Core/PlatformUtils.cs
+++ b/src/shared/Core/PlatformUtils.cs
@@ -19,7 +19,7 @@ public static PlatformInformation GetPlatformInformation(ITrace2 trace2)
string osType = GetOSType();
string osVersion = GetOSVersion(trace2);
string cpuArch = GetCpuArchitecture();
- string clrVersion = GetClrVersion();
+ string clrVersion = RuntimeInformation.FrameworkDescription;
return new PlatformInformation(osType, osVersion, cpuArch, clrVersion);
}
@@ -99,11 +99,7 @@ public static bool IsWindowsBrokerSupported()
/// True if running on macOS, false otherwise.
public static bool IsMacOS()
{
-#if NETFRAMEWORK
- return Environment.OSVersion.Platform == PlatformID.MacOSX;
-#else
return RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
-#endif
}
///
@@ -112,11 +108,7 @@ public static bool IsMacOS()
/// True if running on Windows, false otherwise.
public static bool IsWindows()
{
-#if NETFRAMEWORK
- return Environment.OSVersion.Platform == PlatformID.Win32NT;
-#else
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
-#endif
}
///
@@ -125,11 +117,7 @@ public static bool IsWindows()
/// True if running on a Linux distribution, false otherwise.
public static bool IsLinux()
{
-#if NETFRAMEWORK
- return Environment.OSVersion.Platform == PlatformID.Unix;
-#else
return RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
-#endif
}
///
@@ -459,9 +447,6 @@ string GetLinuxDistroVersion()
private static string GetCpuArchitecture()
{
-#if NETFRAMEWORK
- return Environment.Is64BitOperatingSystem ? "x86-64" : "x86";
-#else
switch (RuntimeInformation.OSArchitecture)
{
case Architecture.Arm:
@@ -475,16 +460,6 @@ private static string GetCpuArchitecture()
default:
return RuntimeInformation.OSArchitecture.ToString();
}
-#endif
- }
-
- private static string GetClrVersion()
- {
-#if NETFRAMEWORK
- return $".NET Framework {Environment.Version}";
-#else
- return RuntimeInformation.FrameworkDescription;
-#endif
}
#endregion