Skip to content

Commit 97d39b0

Browse files
committed
platformutils: use Version.ToString() to get number only
Use Environment.OSVersion.Version.ToString() over .VersionString to get a numercal version only on Windows and macOS. Using .VersionString on macOS you get values like "Unix 13.3.1" rather than "13.3.1", and on Windows you get "Microsoft Windows NT 10.x.y.z" rather than "10.x.y.z".
1 parent 0a16b0e commit 97d39b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/shared/Core/PlatformUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ private static string GetOSVersion(ITrace2 trace2)
372372
#endif
373373
if (IsWindows() || IsMacOS())
374374
{
375-
return Environment.OSVersion.VersionString;
375+
return Environment.OSVersion.Version.ToString();
376376
}
377377

378378
if (IsLinux())

0 commit comments

Comments
 (0)