Skip to content

Commit c8bec66

Browse files
authored
platformutils: use Version.ToString() to get number only (#1264)
Use `Environment.OSVersion.Version.ToString()` over `.VersionString` to get a numerical 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".
2 parents 5f22e5e + 97d39b0 commit c8bec66

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)