diff --git a/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs b/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs index 9dc051c711e..b45dab48cbd 100644 --- a/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs +++ b/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs @@ -394,7 +394,7 @@ private Stream TryConnectToProcess(int nodeProcessId, int timeout, Handshake han CommunicationsUtilities.Trace("Reading handshake from pipe {0}", pipeName); -#if NETCOREAPP2_1 || MONO +#if NETCOREAPP2_1_OR_GREATER || MONO nodeStream.ReadEndOfHandshakeSignal(true, timeout); #else nodeStream.ReadEndOfHandshakeSignal(true); diff --git a/src/MSBuild.UnitTests/ValidateAssemblyLoadContext.cs b/src/MSBuild.UnitTests/ValidateAssemblyLoadContext.cs index 4cdcab25b0d..8670b4d358e 100644 --- a/src/MSBuild.UnitTests/ValidateAssemblyLoadContext.cs +++ b/src/MSBuild.UnitTests/ValidateAssemblyLoadContext.cs @@ -23,7 +23,6 @@ public override bool Execute() // This probably doesn't need to be how it is forever: https://github.com/microsoft/msbuild/issues/5041 if (thisLoadContext.GetType().FullName == typeof(MSBuildLoadContext).FullName) { -#if NETCOREAPP && !NETCOREAPP2_1 // TODO: enable this functionality when targeting .NET Core 3.0+ if (!thisLoadContext.Name.EndsWith(typeof(ValidateAssemblyLoadContext).Assembly.GetName().Name + ".dll")) { Log.LogError($"Unexpected AssemblyLoadContext name: \"{thisLoadContext.Name}\", but the current executing assembly was {typeof(ValidateAssemblyLoadContext).Assembly.GetName().Name}"); @@ -32,7 +31,6 @@ public override bool Execute() { Log.LogMessage(MessageImportance.High, $"Task {nameof(ValidateAssemblyLoadContext)} loaded in AssemblyLoadContext named {thisLoadContext.Name}"); } -#endif } else { diff --git a/src/Shared/CommunicationsUtilities.cs b/src/Shared/CommunicationsUtilities.cs index e5333429e68..f8337625465 100644 --- a/src/Shared/CommunicationsUtilities.cs +++ b/src/Shared/CommunicationsUtilities.cs @@ -332,14 +332,14 @@ internal static void WriteIntForHandshake(this PipeStream stream, int value) } internal static void ReadEndOfHandshakeSignal(this PipeStream stream, bool isProvider -#if NETCOREAPP2_1 || MONO +#if NETCOREAPP2_1_OR_GREATER || MONO , int timeout #endif ) { // Accept only the first byte of the EndOfHandshakeSignal int valueRead = stream.ReadIntForHandshake(null -#if NETCOREAPP2_1 || MONO +#if NETCOREAPP2_1_OR_GREATER || MONO , timeout #endif ); @@ -363,14 +363,14 @@ internal static void ReadEndOfHandshakeSignal(this PipeStream stream, bool isPro /// If specified, leading byte matches one in the supplied array if any, returns rejection byte and throws IOException. /// internal static int ReadIntForHandshake(this PipeStream stream, byte? byteToAccept -#if NETCOREAPP2_1 || MONO +#if NETCOREAPP2_1_OR_GREATER || MONO , int timeout #endif ) { byte[] bytes = new byte[4]; -#if NETCOREAPP2_1 || MONO +#if NETCOREAPP2_1_OR_GREATER || MONO if (!NativeMethodsShared.IsWindows) { // Enforce a minimum timeout because the Windows code can pass diff --git a/src/Shared/NodeEndpointOutOfProcBase.cs b/src/Shared/NodeEndpointOutOfProcBase.cs index c58bc449a1c..99f43c83280 100644 --- a/src/Shared/NodeEndpointOutOfProcBase.cs +++ b/src/Shared/NodeEndpointOutOfProcBase.cs @@ -31,7 +31,7 @@ internal abstract class NodeEndpointOutOfProcBase : INodeEndpoint { #region Private Data -#if NETCOREAPP2_1 || MONO +#if NETCOREAPP2_1_OR_GREATER || MONO /// /// The amount of time to wait for the client to connect to the host. /// @@ -386,7 +386,7 @@ private void PacketPumpProc() for (int i = 0; i < handshakeComponents.Length; i++) { int handshakePart = _pipeServer.ReadIntForHandshake(i == 0 ? (byte?)CommunicationsUtilities.handshakeVersion : null /* this will disconnect a < 16.8 host; it expects leading 00 or F5 or 06. 0x00 is a wildcard */ -#if NETCOREAPP2_1 || MONO +#if NETCOREAPP2_1_OR_GREATER || MONO , ClientConnectTimeout /* wait a long time for the handshake from this side */ #endif ); @@ -403,7 +403,7 @@ private void PacketPumpProc() if (gotValidConnection) { // To ensure that our handshake and theirs have the same number of bytes, receive and send a magic number indicating EOS. -#if NETCOREAPP2_1 || MONO +#if NETCOREAPP2_1_OR_GREATER || MONO _pipeServer.ReadEndOfHandshakeSignal(false, ClientConnectTimeout); /* wait a long time for the handshake from this side */ #else _pipeServer.ReadEndOfHandshakeSignal(false);