diff --git a/src/Microsoft.AspNet.Server.Kestrel/Infrastructure/TaskUtilities.cs b/src/Microsoft.AspNet.Server.Kestrel/Infrastructure/TaskUtilities.cs index 6a56e7507a..c0c4c11acc 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Infrastructure/TaskUtilities.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Infrastructure/TaskUtilities.cs @@ -7,7 +7,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Infrastructure { public static class TaskUtilities { -#if DOTNET5_4 || DNXCORE50 +#if DOTNET5_4 public static Task CompletedTask = Task.CompletedTask; #else public static Task CompletedTask = Task.FromResult(null); diff --git a/src/Microsoft.AspNet.Server.Kestrel/Networking/Libuv.cs b/src/Microsoft.AspNet.Server.Kestrel/Networking/Libuv.cs index 2f6a74fced..abe9aa1d56 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Networking/Libuv.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Networking/Libuv.cs @@ -12,12 +12,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Networking { IsWindows = PlatformApis.IsWindows; - var isDarwinMono = -#if DNX451 - IsWindows ? false : PlatformApis.IsDarwin; -#else - false; -#endif + 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 6117520b3f..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 { @@ -10,7 +11,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Networking { static PlatformApis() { -#if DOTNET5_4 || DNXCORE50 +#if DOTNET5_4 IsWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); IsDarwin = RuntimeInformation.IsOSPlatform(OSPlatform.OSX); #else @@ -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/compiler/preprocess/SPCM.cs b/src/Microsoft.AspNet.Server.Kestrel/compiler/preprocess/SPCM.cs deleted file mode 100644 index df92e585fc..0000000000 --- a/src/Microsoft.AspNet.Server.Kestrel/compiler/preprocess/SPCM.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Microsoft.AspNet.Server.Kestrel -{ - public class StandardsPoliceCompileModule : Microsoft.StandardsPolice.StandardsPoliceCompileModule - { - } -} diff --git a/src/Microsoft.AspNet.Server.Kestrel/project.json b/src/Microsoft.AspNet.Server.Kestrel/project.json index 2e0caab7c0..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-*", @@ -24,28 +25,7 @@ "System.Threading.Tasks.Extensions": "4.0.0-*" }, "frameworks": { - "dnx451": { }, "net451": { }, - "dnxcore50": { - "dependencies": { - "System.Collections": "4.0.11-*", - "System.Diagnostics.Debug": "4.0.11-*", - "System.Diagnostics.TraceSource": "4.0.0-*", - "System.Diagnostics.Tracing": "4.0.21-*", - "System.Globalization": "4.0.11-*", - "System.IO": "4.0.11-*", - "System.Linq": "4.0.1-*", - "System.Net.Primitives": "4.0.11-*", - "System.Runtime.Extensions": "4.0.11-*", - "System.Runtime.InteropServices": "4.0.21-*", - "System.Text.Encoding": "4.0.11-*", - "System.Threading": "4.0.11-*", - "System.Threading.Tasks": "4.0.11-*", - "System.Threading.Thread": "4.0.0-*", - "System.Threading.ThreadPool": "4.0.10-*", - "System.Threading.Timer": "4.0.1-*" - } - }, "dotnet5.4": { "dependencies": { "System.Collections": "4.0.11-*",