diff --git a/build/dependencies.props b/build/dependencies.props index 378bc93..3e33857 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -6,7 +6,7 @@ 2.1.0-* 10.0.1 $(BundledNETStandardPackageVersion) - 2.0.0-* + 2.0.0-* 4.7.0 diff --git a/src/Microsoft.AspNetCore.NodeServices.Sockets/Microsoft.AspNetCore.NodeServices.Sockets.csproj b/src/Microsoft.AspNetCore.NodeServices.Sockets/Microsoft.AspNetCore.NodeServices.Sockets.csproj index 8ebd6a6..91b1a4b 100644 --- a/src/Microsoft.AspNetCore.NodeServices.Sockets/Microsoft.AspNetCore.NodeServices.Sockets.csproj +++ b/src/Microsoft.AspNetCore.NodeServices.Sockets/Microsoft.AspNetCore.NodeServices.Sockets.csproj @@ -4,7 +4,7 @@ Socket-based RPC for Microsoft.AspNetCore.NodeServices. - netcoreapp2.0 + netstandard2.0 aspnetcore;aspnetcoremvc;nodeservices true @@ -15,14 +15,6 @@ - - - - - - - - diff --git a/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/NamedPipeConnection.cs b/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/NamedPipeConnection.cs index d50d146..5fcd667 100644 --- a/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/NamedPipeConnection.cs +++ b/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/NamedPipeConnection.cs @@ -18,11 +18,7 @@ namespace Microsoft.AspNetCore.NodeServices.Sockets.PhysicalConnections PipeDirection.InOut, PipeOptions.Asynchronous); -#if NET451 - _namedPipeClientStream.Connect(); -#else await _namedPipeClientStream.ConnectAsync().ConfigureAwait(false); -#endif return _namedPipeClientStream; } diff --git a/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/StreamConnection.cs b/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/StreamConnection.cs index 535a762..cbd1f99 100644 --- a/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/StreamConnection.cs +++ b/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/StreamConnection.cs @@ -11,9 +11,6 @@ namespace Microsoft.AspNetCore.NodeServices.Sockets.PhysicalConnections public static StreamConnection Create() { -#if NET451 - return new NamedPipeConnection(); -#else var useNamedPipes = System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform( System.Runtime.InteropServices.OSPlatform.Windows); if (useNamedPipes) @@ -24,7 +21,6 @@ namespace Microsoft.AspNetCore.NodeServices.Sockets.PhysicalConnections { return new UnixDomainSocketConnection(); } -#endif } } } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/UnixDomainSocketConnection.cs b/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/UnixDomainSocketConnection.cs index 1f12a71..6e7ebac 100644 --- a/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/UnixDomainSocketConnection.cs +++ b/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/UnixDomainSocketConnection.cs @@ -10,16 +10,6 @@ namespace Microsoft.AspNetCore.NodeServices.Sockets.PhysicalConnections private NetworkStream _networkStream; private Socket _socket; -#if NET451 - public override Task Open(string address) - { - // The 'null' assignments avoid the compiler warnings about unassigned fields. - // Note that this whole class isn't supported on .NET 4.5.1, since that's not cross-platform. - _networkStream = null; - _socket = null; - throw new System.PlatformNotSupportedException(); - } -#else public override async Task Open(string address) { var endPoint = new UnixDomainSocketEndPoint("/tmp/" + address); @@ -28,7 +18,6 @@ namespace Microsoft.AspNetCore.NodeServices.Sockets.PhysicalConnections _networkStream = new NetworkStream(_socket); return _networkStream; } -#endif public override void Dispose() { diff --git a/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/UnixDomainSocketEndPoint.cs b/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/UnixDomainSocketEndPoint.cs index ff43b01..b001163 100644 --- a/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/UnixDomainSocketEndPoint.cs +++ b/src/Microsoft.AspNetCore.NodeServices.Sockets/PhysicalConnections/UnixDomainSocketEndPoint.cs @@ -59,11 +59,7 @@ namespace Microsoft.AspNetCore.NodeServices.Sockets.PhysicalConnections } else { -#if NET451 - _encodedPath = new byte[0]; -#else _encodedPath = Array.Empty(); -#endif _path = string.Empty; } } diff --git a/src/Microsoft.AspNetCore.NodeServices.Sockets/VirtualConnections/VirtualConnection.cs b/src/Microsoft.AspNetCore.NodeServices.Sockets/VirtualConnections/VirtualConnection.cs index 611dff1..391b1f7 100644 --- a/src/Microsoft.AspNetCore.NodeServices.Sockets/VirtualConnections/VirtualConnection.cs +++ b/src/Microsoft.AspNetCore.NodeServices.Sockets/VirtualConnections/VirtualConnection.cs @@ -12,11 +12,7 @@ namespace Microsoft.AspNetCore.NodeServices.Sockets.VirtualConnections /// internal class VirtualConnection : Stream { -#if NET451 - private readonly static Task CompletedTask = Task.FromResult((object)null); -#else private readonly static Task CompletedTask = Task.CompletedTask; -#endif private VirtualConnectionClient _host; private readonly BufferBlock _receivedDataQueue = new BufferBlock(); private ArraySegment _receivedDataNotYetUsed; diff --git a/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs b/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs index 7f6f172..6bfa177 100644 --- a/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs +++ b/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs @@ -315,11 +315,7 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels private static void SetEnvironmentVariable(ProcessStartInfo startInfo, string name, string value) { -#if NET451 - startInfo.EnvironmentVariables[name] = value; -#else startInfo.Environment[name] = value; -#endif } private static Process LaunchNodeProcess(ProcessStartInfo startInfo) diff --git a/src/Microsoft.AspNetCore.NodeServices/Microsoft.AspNetCore.NodeServices.csproj b/src/Microsoft.AspNetCore.NodeServices/Microsoft.AspNetCore.NodeServices.csproj index f5be3ac..27d8c62 100644 --- a/src/Microsoft.AspNetCore.NodeServices/Microsoft.AspNetCore.NodeServices.csproj +++ b/src/Microsoft.AspNetCore.NodeServices/Microsoft.AspNetCore.NodeServices.csproj @@ -4,7 +4,7 @@ Invoke Node.js modules at runtime in ASP.NET Core applications. - netcoreapp2.0 + netstandard2.0 aspnetcore;aspnetcoremvc;nodeservices true true @@ -18,11 +18,6 @@ - - - - - diff --git a/src/Microsoft.AspNetCore.NodeServices/Util/StringAsTempFile.cs b/src/Microsoft.AspNetCore.NodeServices/Util/StringAsTempFile.cs index 22f4b01..a798b31 100644 --- a/src/Microsoft.AspNetCore.NodeServices/Util/StringAsTempFile.cs +++ b/src/Microsoft.AspNetCore.NodeServices/Util/StringAsTempFile.cs @@ -23,15 +23,10 @@ namespace Microsoft.AspNetCore.NodeServices // Because .NET finalizers don't reliably run when the process is terminating, also // add event handlers for other shutdown scenarios. -#if NET451 - AppDomain.CurrentDomain.ProcessExit += HandleProcessExit; - AppDomain.CurrentDomain.DomainUnload += HandleProcessExit; -#else // Note that this still doesn't capture SIGKILL (at least on macOS) - there doesn't // appear to be a way of doing that. So in that case, the temporary file will be // left behind. System.Runtime.Loader.AssemblyLoadContext.Default.Unloading += HandleAssemblyUnloading; -#endif } /// @@ -55,12 +50,7 @@ namespace Microsoft.AspNetCore.NodeServices if (disposing) { // Dispose managed state -#if NET451 - AppDomain.CurrentDomain.ProcessExit -= HandleProcessExit; - AppDomain.CurrentDomain.DomainUnload -= HandleProcessExit; -#else System.Runtime.Loader.AssemblyLoadContext.Default.Unloading -= HandleAssemblyUnloading; -#endif } EnsureTempFileDeleted(); @@ -81,17 +71,10 @@ namespace Microsoft.AspNetCore.NodeServices } } -#if NET451 - private void HandleProcessExit(object sender, EventArgs args) - { - EnsureTempFileDeleted(); - } -#else private void HandleAssemblyUnloading(System.Runtime.Loader.AssemblyLoadContext context) { EnsureTempFileDeleted(); } -#endif /// /// Implements the finalization part of the IDisposable pattern by calling Dispose(false). diff --git a/src/Microsoft.AspNetCore.SpaServices/Microsoft.AspNetCore.SpaServices.csproj b/src/Microsoft.AspNetCore.SpaServices/Microsoft.AspNetCore.SpaServices.csproj index 53d7c7b..5d90573 100644 --- a/src/Microsoft.AspNetCore.SpaServices/Microsoft.AspNetCore.SpaServices.csproj +++ b/src/Microsoft.AspNetCore.SpaServices/Microsoft.AspNetCore.SpaServices.csproj @@ -4,7 +4,7 @@ Helpers for building single-page applications on ASP.NET MVC Core. - netcoreapp2.0 + netstandard2.0 aspnetcore;aspnetcoremvc;nodeservices true true @@ -13,7 +13,8 @@ - + +