Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 8ee3d5c

Browse files
committed
Looking at OS Env var looks like a more reliable way to check for Win
1 parent 1cad09d commit 8ee3d5c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ServiceStack.Text/Env.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ static Env()
3838

3939
#if PCL || NETSTANDARD1_1
4040
IsUnix = IsMono;
41+
IsWin = !IsUnix;
4142
#else
4243
var platform = (int)Environment.OSVersion.Platform;
4344
IsUnix = (platform == 4) || (platform == 6) || (platform == 128);
45+
IsWin = Environment.GetEnvironmentVariable("OS")?.IndexOf("Windows", StringComparison.OrdinalIgnoreCase) >= 0;
4446
#endif
45-
IsWin = !IsUnix;
4647

4748
ServerUserAgent = "ServiceStack/" +
4849
ServiceStackVersion + " "

0 commit comments

Comments
 (0)