diff --git a/src/Microsoft.AspNet.Server.Kestrel/Networking/Libuv.cs b/src/Microsoft.AspNet.Server.Kestrel/Networking/Libuv.cs index 497a6c42a0..abe9aa1d56 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Networking/Libuv.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Networking/Libuv.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Networking { IsWindows = PlatformApis.IsWindows; - var isDarwinMono = !IsWindows && PlatformApis.IsDarwin; + var isDarwinMono = PlatformApis.IsDarwin && PlatformApis.IsMono; if (isDarwinMono) { diff --git a/src/Microsoft.AspNet.Server.Kestrel/Networking/PlatformApis.cs b/src/Microsoft.AspNet.Server.Kestrel/Networking/PlatformApis.cs index ae8ce0383f..a1915ff372 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Networking/PlatformApis.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Networking/PlatformApis.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.InteropServices; +using Microsoft.Extensions.PlatformAbstractions; namespace Microsoft.AspNet.Server.Kestrel.Networking { @@ -24,12 +25,16 @@ namespace Microsoft.AspNet.Server.Kestrel.Networking IsDarwin = string.Equals(GetUname(), "Darwin", StringComparison.Ordinal); } #endif + + IsMono = PlatformServices.Default.Runtime.RuntimeType == "Mono"; } public static bool IsWindows { get; } public static bool IsDarwin { get; } + public static bool IsMono { get; } + [DllImport("libc")] static extern int uname(IntPtr buf); diff --git a/src/Microsoft.AspNet.Server.Kestrel/project.json b/src/Microsoft.AspNet.Server.Kestrel/project.json index 09c6c9851c..4cb8e6bd5d 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/project.json +++ b/src/Microsoft.AspNet.Server.Kestrel/project.json @@ -8,6 +8,7 @@ "dependencies": { "Microsoft.AspNet.Hosting": "1.0.0-*", "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*", + "Microsoft.Extensions.PlatformAbstractions": "1.0.0-*", "System.Numerics.Vectors": "4.1.1-*", "Microsoft.StandardsPolice": { "version": "1.0.0-*",