diff --git a/src/Servers/Kestrel/Core/src/Adapter/Internal/AdaptedPipeline.cs b/src/Servers/Kestrel/Core/src/Adapter/Internal/AdaptedPipeline.cs index eb65aac253..4b591a717d 100644 --- a/src/Servers/Kestrel/Core/src/Adapter/Internal/AdaptedPipeline.cs +++ b/src/Servers/Kestrel/Core/src/Adapter/Internal/AdaptedPipeline.cs @@ -74,27 +74,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal } else if (buffer.IsSingleSegment) { -#if NETCOREAPP2_1 await stream.WriteAsync(buffer.First); -#elif NETSTANDARD2_0 - var array = buffer.First.GetArray(); - await stream.WriteAsync(array.Array, array.Offset, array.Count); -#else -#error TFMs need to be updated -#endif } else { foreach (var memory in buffer) { -#if NETCOREAPP2_1 await stream.WriteAsync(memory); -#elif NETSTANDARD2_0 - var array = memory.GetArray(); - await stream.WriteAsync(array.Array, array.Offset, array.Count); -#else -#error TFMs need to be updated -#endif } } } @@ -131,14 +117,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal { var outputBuffer = Input.Writer.GetMemory(MinAllocBufferSize); -#if NETCOREAPP2_1 var bytesRead = await stream.ReadAsync(outputBuffer); -#elif NETSTANDARD2_0 - var array = outputBuffer.GetArray(); - var bytesRead = await stream.ReadAsync(array.Array, array.Offset, array.Count); -#else -#error TFMs need to be updated -#endif Input.Writer.Advance(bytesRead); if (bytesRead == 0) diff --git a/src/Servers/Kestrel/Core/src/Adapter/Internal/LoggingStream.cs b/src/Servers/Kestrel/Core/src/Adapter/Internal/LoggingStream.cs index 42722f2413..d7d5e85590 100644 --- a/src/Servers/Kestrel/Core/src/Adapter/Internal/LoggingStream.cs +++ b/src/Servers/Kestrel/Core/src/Adapter/Internal/LoggingStream.cs @@ -83,17 +83,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal return read; } -#if NETCOREAPP2_1 public override int Read(Span destination) { int read = _inner.Read(destination); Log("Read", destination.Slice(0, read)); return read; } -#elif NETSTANDARD2_0 -#else -#error TFMs need to be updated -#endif public async override Task ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { @@ -102,17 +97,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal return read; } -#if NETCOREAPP2_1 public override async ValueTask ReadAsync(Memory destination, CancellationToken cancellationToken = default) { int read = await _inner.ReadAsync(destination, cancellationToken); Log("ReadAsync", destination.Span.Slice(0, read)); return read; } -#elif NETSTANDARD2_0 -#else -#error TFMs need to be updated -#endif public override long Seek(long offset, SeekOrigin origin) { @@ -130,16 +120,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal _inner.Write(buffer, offset, count); } -#if NETCOREAPP2_1 public override void Write(ReadOnlySpan source) { Log("Write", source); _inner.Write(source); } -#elif NETSTANDARD2_0 -#else -#error TFMs need to be updated -#endif public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { @@ -147,16 +132,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal return _inner.WriteAsync(buffer, offset, count, cancellationToken); } -#if NETCOREAPP2_1 public override ValueTask WriteAsync(ReadOnlyMemory source, CancellationToken cancellationToken = default) { Log("WriteAsync", source.Span); return _inner.WriteAsync(source, cancellationToken); } -#elif NETSTANDARD2_0 -#else -#error TFMs need to be updated -#endif private void Log(string method, ReadOnlySpan buffer) { diff --git a/src/Servers/Kestrel/Core/src/Adapter/Internal/RawStream.cs b/src/Servers/Kestrel/Core/src/Adapter/Internal/RawStream.cs index 137b87ea04..837bc8ec05 100644 --- a/src/Servers/Kestrel/Core/src/Adapter/Internal/RawStream.cs +++ b/src/Servers/Kestrel/Core/src/Adapter/Internal/RawStream.cs @@ -69,15 +69,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal return ReadAsyncInternal(new Memory(buffer, offset, count)).AsTask(); } -#if NETCOREAPP2_1 public override ValueTask ReadAsync(Memory destination, CancellationToken cancellationToken = default) { return ReadAsyncInternal(destination); } -#elif NETSTANDARD2_0 -#else -#error TFMs need to be updated -#endif public override void Write(byte[] buffer, int offset, int count) { @@ -94,16 +89,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal await _output.FlushAsync(cancellationToken); } -#if NETCOREAPP2_1 public override async ValueTask WriteAsync(ReadOnlyMemory source, CancellationToken cancellationToken = default) { _output.Write(source.Span); await _output.FlushAsync(cancellationToken); } -#elif NETSTANDARD2_0 -#else -#error TFMs need to be updated -#endif public override void Flush() { diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpRequestStream.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpRequestStream.cs index 3451bcdb30..a160d9180e 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpRequestStream.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpRequestStream.cs @@ -111,17 +111,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http return ReadAsyncInternal(new Memory(buffer, offset, count), cancellationToken).AsTask(); } -#if NETCOREAPP2_1 public override ValueTask ReadAsync(Memory destination, CancellationToken cancellationToken = default) { ValidateState(cancellationToken); return ReadAsyncInternal(destination, cancellationToken); } -#elif NETSTANDARD2_0 -#else -#error TFMs need to be updated -#endif private async ValueTask ReadAsyncInternal(Memory buffer, CancellationToken cancellationToken) { diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseStream.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseStream.cs index 79d31367c8..2d50902e31 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseStream.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseStream.cs @@ -112,17 +112,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http return _httpResponseControl.WriteAsync(new ReadOnlyMemory(buffer, offset, count), cancellationToken); } -#if NETCOREAPP2_1 public override ValueTask WriteAsync(ReadOnlyMemory source, CancellationToken cancellationToken = default) { ValidateState(cancellationToken); return new ValueTask(_httpResponseControl.WriteAsync(source, cancellationToken)); } -#elif NETSTANDARD2_0 -#else -#error TFMs need to be updated -#endif public void StartAcceptingWrites() { diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpUpgradeStream.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpUpgradeStream.cs index 0b89d00ed1..4557e6609d 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpUpgradeStream.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpUpgradeStream.cs @@ -145,15 +145,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http return _requestStream.ReadAsync(buffer, offset, count, cancellationToken); } -#if NETCOREAPP2_1 public override ValueTask ReadAsync(Memory destination, CancellationToken cancellationToken = default) { return _requestStream.ReadAsync(destination, cancellationToken); } -#elif NETSTANDARD2_0 -#else -#error TFMs need to be updated -#endif public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) { @@ -165,15 +160,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http return _responseStream.WriteAsync(buffer, offset, count, cancellationToken); } -#if NETCOREAPP2_1 public override ValueTask WriteAsync(ReadOnlyMemory source, CancellationToken cancellationToken = default) { return _responseStream.WriteAsync(source, cancellationToken); } -#elif NETSTANDARD2_0 -#else -#error TFMs need to be updated -#endif public override long Seek(long offset, SeekOrigin origin) { diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/MessageBody.cs b/src/Servers/Kestrel/Core/src/Internal/Http/MessageBody.cs index 750a490793..30248cac50 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/MessageBody.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/MessageBody.cs @@ -113,15 +113,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http // REVIEW: This *could* be slower if 2 things are true // - The WriteAsync(ReadOnlyMemory) isn't overridden on the destination // - We change the Kestrel Memory Pool to not use pinned arrays but instead use native memory - -#if NETCOREAPP2_1 await destination.WriteAsync(memory, cancellationToken); -#elif NETSTANDARD2_0 - var array = memory.GetArray(); - await destination.WriteAsync(array.Array, array.Offset, array.Count, cancellationToken); -#else -#error TFMs need to be updated -#endif } } diff --git a/src/Servers/Kestrel/Core/src/Internal/HttpsConnectionAdapter.cs b/src/Servers/Kestrel/Core/src/Internal/HttpsConnectionAdapter.cs index 4abeabc80a..5b365c9bc3 100644 --- a/src/Servers/Kestrel/Core/src/Internal/HttpsConnectionAdapter.cs +++ b/src/Servers/Kestrel/Core/src/Internal/HttpsConnectionAdapter.cs @@ -131,7 +131,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal try { -#if NETCOREAPP2_1 // Adapt to the SslStream signature ServerCertificateSelectionCallback selector = null; if (_serverCertificateSelector != null) @@ -172,22 +171,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal } await sslStream.AuthenticateAsServerAsync(sslOptions, CancellationToken.None); -#elif NETSTANDARD2_0 // No ALPN support - var serverCert = _serverCertificate; - if (_serverCertificateSelector != null) - { - context.Features.Set(sslStream); - serverCert = _serverCertificateSelector(context.ConnectionContext, null); - if (serverCert != null) - { - EnsureCertificateIsAllowedForServerAuth(serverCert); - } - } - await sslStream.AuthenticateAsServerAsync(serverCert, certificateRequired, - _options.SslProtocols, _options.CheckCertificateRevocation); -#else -#error TFMs need to be updated -#endif } catch (OperationCanceledException) { @@ -206,13 +189,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal timeoutFeature.CancelTimeout(); } -#if NETCOREAPP2_1 feature.ApplicationProtocol = sslStream.NegotiatedApplicationProtocol.Protocol; context.Features.Set(feature); -#elif NETSTANDARD2_0 // No ALPN support -#else -#error TFMs need to be updated -#endif feature.ClientCertificate = ConvertToX509Certificate2(sslStream.RemoteCertificate); feature.CipherAlgorithm = sslStream.CipherAlgorithm; feature.CipherStrength = sslStream.CipherStrength; diff --git a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/WrappingStream.cs b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/WrappingStream.cs index 0be1c97d7e..6f1b13c39b 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/WrappingStream.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/WrappingStream.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -68,13 +68,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure public override Task ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => _inner.ReadAsync(buffer, offset, count, cancellationToken); -#if NETCOREAPP2_1 public override ValueTask ReadAsync(Memory destination, CancellationToken cancellationToken = default) => _inner.ReadAsync(destination, cancellationToken); -#elif NETSTANDARD2_0 -#else -#error TFMs need to be updated -#endif public override int ReadByte() => _inner.ReadByte(); @@ -91,13 +86,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => _inner.WriteAsync(buffer, offset, count, cancellationToken); -#if NETCOREAPP2_1 public override ValueTask WriteAsync(ReadOnlyMemory source, CancellationToken cancellationToken = default) => _inner.WriteAsync(source, cancellationToken); -#elif NETSTANDARD2_0 -#else -#error TFMs need to be updated -#endif public override void WriteByte(byte value) => _inner.WriteByte(value); diff --git a/src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj b/src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj index 90d916537e..04fd9fff4f 100644 --- a/src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj +++ b/src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj @@ -2,7 +2,7 @@ Core components of ASP.NET Core Kestrel cross-platform web server. - netstandard2.0;netcoreapp2.1 + netcoreapp3.0 true aspnetcore;kestrel true diff --git a/src/Servers/Kestrel/Core/test/HttpRequestStreamTests.cs b/src/Servers/Kestrel/Core/test/HttpRequestStreamTests.cs index a9b0f97268..ee3c21a042 100644 --- a/src/Servers/Kestrel/Core/test/HttpRequestStreamTests.cs +++ b/src/Servers/Kestrel/Core/test/HttpRequestStreamTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -85,18 +85,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await Assert.ThrowsAsync(() => stream.WriteAsync(new byte[1], 0, 1)); } -#if NET461 - [Fact] - public void BeginWriteThrows() - { - var stream = new HttpRequestStream(Mock.Of()); - Assert.Throws(() => stream.BeginWrite(new byte[1], 0, 1, null, null)); - } -#elif NETCOREAPP2_2 -#else -#error Target framework needs to be updated -#endif - [Fact] // Read-only streams should support Flush according to https://github.com/dotnet/corefx/pull/27327#pullrequestreview-98384813 public void FlushDoesNotThrow() diff --git a/src/Servers/Kestrel/Core/test/Microsoft.AspNetCore.Server.Kestrel.Core.Tests.csproj b/src/Servers/Kestrel/Core/test/Microsoft.AspNetCore.Server.Kestrel.Core.Tests.csproj index 1ba8b542d1..1db176d5eb 100644 --- a/src/Servers/Kestrel/Core/test/Microsoft.AspNetCore.Server.Kestrel.Core.Tests.csproj +++ b/src/Servers/Kestrel/Core/test/Microsoft.AspNetCore.Server.Kestrel.Core.Tests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.2;net461 + netcoreapp3.0 true diff --git a/src/Servers/Kestrel/Kestrel/src/Microsoft.AspNetCore.Server.Kestrel.csproj b/src/Servers/Kestrel/Kestrel/src/Microsoft.AspNetCore.Server.Kestrel.csproj index 60e282fe82..7394ffae00 100644 --- a/src/Servers/Kestrel/Kestrel/src/Microsoft.AspNetCore.Server.Kestrel.csproj +++ b/src/Servers/Kestrel/Kestrel/src/Microsoft.AspNetCore.Server.Kestrel.csproj @@ -2,7 +2,7 @@ ASP.NET Core Kestrel cross-platform web server. - netstandard2.0 + netcoreapp3.0 true aspnetcore;kestrel CS1591;$(NoWarn) diff --git a/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs b/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs index e561f0cc21..f91bee1dd6 100644 --- a/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs +++ b/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs @@ -1,7 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -#if NETCOREAPP2_2 using System; using System.IO; using System.Linq; @@ -57,7 +56,3 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } } } -#elif NET461 -#else -#error Target framework needs to be updated -#endif diff --git a/src/Servers/Kestrel/Kestrel/test/Microsoft.AspNetCore.Server.Kestrel.Tests.csproj b/src/Servers/Kestrel/Kestrel/test/Microsoft.AspNetCore.Server.Kestrel.Tests.csproj index ab8048acb8..1a91bad913 100644 --- a/src/Servers/Kestrel/Kestrel/test/Microsoft.AspNetCore.Server.Kestrel.Tests.csproj +++ b/src/Servers/Kestrel/Kestrel/test/Microsoft.AspNetCore.Server.Kestrel.Tests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.2;net461 + netcoreapp3.0 diff --git a/src/Servers/Kestrel/Transport.Abstractions/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.csproj b/src/Servers/Kestrel/Transport.Abstractions/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.csproj index e6d51dac8f..39c53a73ff 100644 --- a/src/Servers/Kestrel/Transport.Abstractions/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.csproj +++ b/src/Servers/Kestrel/Transport.Abstractions/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.csproj @@ -2,7 +2,7 @@ Transport abstractions for the ASP.NET Core Kestrel cross-platform web server. - netstandard2.0 + netcoreapp3.0 true aspnetcore;kestrel CS1570;CS1571;CS1572;CS1573;CS1574;CS1591;$(NoWarn) diff --git a/src/Servers/Kestrel/Transport.Libuv/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.csproj b/src/Servers/Kestrel/Transport.Libuv/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.csproj index 001e97cdb6..b7b4f6d53e 100644 --- a/src/Servers/Kestrel/Transport.Libuv/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.csproj +++ b/src/Servers/Kestrel/Transport.Libuv/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.csproj @@ -1,8 +1,8 @@ - + Libuv transport for the ASP.NET Core Kestrel cross-platform web server. - netstandard2.0 + netcoreapp3.0 true aspnetcore;kestrel true diff --git a/src/Servers/Kestrel/Transport.Libuv/test/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Tests.csproj b/src/Servers/Kestrel/Transport.Libuv/test/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Tests.csproj index 17c05a6cd7..bb263e89a3 100644 --- a/src/Servers/Kestrel/Transport.Libuv/test/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Tests.csproj +++ b/src/Servers/Kestrel/Transport.Libuv/test/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Tests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.2;net461 + netcoreapp3.0 true true diff --git a/src/Servers/Kestrel/Transport.Sockets/src/Internal/SocketReceiver.cs b/src/Servers/Kestrel/Transport.Sockets/src/Internal/SocketReceiver.cs index 3c3451cbcc..1888ab8755 100644 --- a/src/Servers/Kestrel/Transport.Sockets/src/Internal/SocketReceiver.cs +++ b/src/Servers/Kestrel/Transport.Sockets/src/Internal/SocketReceiver.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -15,13 +15,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal public SocketAwaitableEventArgs WaitForDataAsync() { -#if NETCOREAPP2_1 _awaitableEventArgs.SetBuffer(Memory.Empty); -#elif NETSTANDARD2_0 - _awaitableEventArgs.SetBuffer(Array.Empty(), 0, 0); -#else -#error TFMs need to be updated -#endif if (!_socket.ReceiveAsync(_awaitableEventArgs)) { @@ -33,15 +27,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal public SocketAwaitableEventArgs ReceiveAsync(Memory buffer) { -#if NETCOREAPP2_1 _awaitableEventArgs.SetBuffer(buffer); -#elif NETSTANDARD2_0 - var segment = buffer.GetArray(); - _awaitableEventArgs.SetBuffer(segment.Array, segment.Offset, segment.Count); -#else -#error TFMs need to be updated -#endif if (!_socket.ReceiveAsync(_awaitableEventArgs)) { _awaitableEventArgs.Complete(); diff --git a/src/Servers/Kestrel/Transport.Sockets/src/Internal/SocketSender.cs b/src/Servers/Kestrel/Transport.Sockets/src/Internal/SocketSender.cs index 4dba6aedb4..62583df05d 100644 --- a/src/Servers/Kestrel/Transport.Sockets/src/Internal/SocketSender.cs +++ b/src/Servers/Kestrel/Transport.Sockets/src/Internal/SocketSender.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -26,13 +26,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal return SendAsync(buffers.First); } -#if NETCOREAPP2_1 if (!_awaitableEventArgs.MemoryBuffer.Equals(Memory.Empty)) -#elif NETSTANDARD2_0 - if (_awaitableEventArgs.Buffer != null) -#else -#error TFMs need to be updated -#endif { _awaitableEventArgs.SetBuffer(null, 0, 0); } @@ -55,15 +49,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal _awaitableEventArgs.BufferList = null; } -#if NETCOREAPP2_1 _awaitableEventArgs.SetBuffer(MemoryMarshal.AsMemory(memory)); -#elif NETSTANDARD2_0 - var segment = memory.GetArray(); - _awaitableEventArgs.SetBuffer(segment.Array, segment.Offset, segment.Count); -#else -#error TFMs need to be updated -#endif if (!_socket.SendAsync(_awaitableEventArgs)) { _awaitableEventArgs.Complete(); diff --git a/src/Servers/Kestrel/Transport.Sockets/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.csproj b/src/Servers/Kestrel/Transport.Sockets/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.csproj index 82dde8daa8..2df07062fd 100644 --- a/src/Servers/Kestrel/Transport.Sockets/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.csproj +++ b/src/Servers/Kestrel/Transport.Sockets/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.csproj @@ -2,7 +2,7 @@ Managed socket transport for the ASP.NET Core Kestrel cross-platform web server. - netstandard2.0;netcoreapp2.1 + netcoreapp3.0 true aspnetcore;kestrel true diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Microsoft.AspNetCore.Server.Kestrel.Performance.csproj b/src/Servers/Kestrel/perf/Kestrel.Performance/Microsoft.AspNetCore.Server.Kestrel.Performance.csproj index 8b6637c1d6..09655f7ca8 100644 --- a/src/Servers/Kestrel/perf/Kestrel.Performance/Microsoft.AspNetCore.Server.Kestrel.Performance.csproj +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Microsoft.AspNetCore.Server.Kestrel.Performance.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + netcoreapp3.0 Exe true true diff --git a/src/Servers/Kestrel/perf/PlatformBenchmarks/PlatformBenchmarks.csproj b/src/Servers/Kestrel/perf/PlatformBenchmarks/PlatformBenchmarks.csproj index 4460a67388..a1895bec47 100644 --- a/src/Servers/Kestrel/perf/PlatformBenchmarks/PlatformBenchmarks.csproj +++ b/src/Servers/Kestrel/perf/PlatformBenchmarks/PlatformBenchmarks.csproj @@ -1,4 +1,4 @@ - + netcoreapp3.0 diff --git a/src/Servers/Kestrel/samples/Http2SampleApp/Http2SampleApp.csproj b/src/Servers/Kestrel/samples/Http2SampleApp/Http2SampleApp.csproj index b367dd576a..c7eb03c2c1 100644 --- a/src/Servers/Kestrel/samples/Http2SampleApp/Http2SampleApp.csproj +++ b/src/Servers/Kestrel/samples/Http2SampleApp/Http2SampleApp.csproj @@ -1,7 +1,7 @@  - netcoreapp2.2;net461 + netcoreapp3.0 false true diff --git a/src/Servers/Kestrel/samples/LargeResponseApp/LargeResponseApp.csproj b/src/Servers/Kestrel/samples/LargeResponseApp/LargeResponseApp.csproj index 6d4786c5b5..976d4df073 100644 --- a/src/Servers/Kestrel/samples/LargeResponseApp/LargeResponseApp.csproj +++ b/src/Servers/Kestrel/samples/LargeResponseApp/LargeResponseApp.csproj @@ -1,7 +1,7 @@  - netcoreapp2.2;net461 + netcoreapp3.0 false true diff --git a/src/Servers/Kestrel/samples/PlaintextApp/PlaintextApp.csproj b/src/Servers/Kestrel/samples/PlaintextApp/PlaintextApp.csproj index 6d4786c5b5..976d4df073 100644 --- a/src/Servers/Kestrel/samples/PlaintextApp/PlaintextApp.csproj +++ b/src/Servers/Kestrel/samples/PlaintextApp/PlaintextApp.csproj @@ -1,7 +1,7 @@  - netcoreapp2.2;net461 + netcoreapp3.0 false true diff --git a/src/Servers/Kestrel/samples/SampleApp/SampleApp.csproj b/src/Servers/Kestrel/samples/SampleApp/SampleApp.csproj index 9e8a0e6269..1e7a08eff7 100644 --- a/src/Servers/Kestrel/samples/SampleApp/SampleApp.csproj +++ b/src/Servers/Kestrel/samples/SampleApp/SampleApp.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.2;net461 + netcoreapp3.0 false true diff --git a/src/Servers/Kestrel/samples/SystemdTestApp/SystemdTestApp.csproj b/src/Servers/Kestrel/samples/SystemdTestApp/SystemdTestApp.csproj index 41aa0ed783..b651cc6cf9 100644 --- a/src/Servers/Kestrel/samples/SystemdTestApp/SystemdTestApp.csproj +++ b/src/Servers/Kestrel/samples/SystemdTestApp/SystemdTestApp.csproj @@ -1,7 +1,7 @@  - netcoreapp2.2;net461 + netcoreapp3.0 false true diff --git a/src/Servers/Kestrel/shared/test/PassThroughConnectionAdapter.cs b/src/Servers/Kestrel/shared/test/PassThroughConnectionAdapter.cs index 351a2c9e93..9f81ceec5f 100644 --- a/src/Servers/Kestrel/shared/test/PassThroughConnectionAdapter.cs +++ b/src/Servers/Kestrel/shared/test/PassThroughConnectionAdapter.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -140,7 +140,6 @@ namespace Microsoft.AspNetCore.Testing _innerStream.Close(); } -#if NETCOREAPP2_2 public override int Read(Span buffer) { return _innerStream.Read(buffer); @@ -165,10 +164,6 @@ namespace Microsoft.AspNetCore.Testing { _innerStream.CopyTo(destination, bufferSize); } -#elif NET461 -#else -#error TFMs need to be updated -#endif } } } diff --git a/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs b/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs index 0b81846e92..446be393dc 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -#if NETCOREAPP2_2 - using System; using System.Net; using System.Net.Http; @@ -95,7 +93,3 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.Http2 } } } -#elif NET461 // No ALPN support -#else -#error TFMs need updating -#endif \ No newline at end of file diff --git a/src/Servers/Kestrel/test/FunctionalTests/Http2/ShutdownTests.cs b/src/Servers/Kestrel/test/FunctionalTests/Http2/ShutdownTests.cs index d1f06974e6..cb7c5a1ee4 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/Http2/ShutdownTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/Http2/ShutdownTests.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -#if NETCOREAPP2_2 - using System.Collections.Generic; using System.Net; using System.Net.Http; @@ -146,7 +144,3 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.Http2 } } } -#elif NET461 // No ALPN support -#else -#error TFMs need updating -#endif \ No newline at end of file diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/TlsTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/TlsTests.cs index f366f1dd0f..85c05798a6 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/TlsTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/TlsTests.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -#if NETCOREAPP2_2 - using System.Collections.Generic; using System.IO; using System.IO.Pipelines; @@ -126,7 +124,3 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests.Http2 } } } -#elif NET461 // No ALPN support -#else -#error TFMs need updating -#endif \ No newline at end of file diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionAdapterTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionAdapterTests.cs index 572e717b80..ae9434642d 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionAdapterTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionAdapterTests.cs @@ -182,13 +182,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests { Assert.NotNull(connection); Assert.NotNull(connection.Features.Get()); -#if NETCOREAPP2_2 Assert.Equal("localhost", name); -#elif NET461 - Assert.Null(name); -#else -#error TFMs need to be updated -#endif selectorCalled++; return _x509Certificate2; } @@ -224,13 +218,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests { Assert.NotNull(connection); Assert.NotNull(connection.Features.Get()); -#if NETCOREAPP2_2 Assert.Equal("localhost", name); -#elif NET461 - Assert.Null(name); -#else -#error TFMs need to be updated -#endif selectorCalled++; if (selectorCalled == 1) { @@ -314,13 +302,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests { Assert.NotNull(connection); Assert.NotNull(connection.Features.Get()); -#if NETCOREAPP2_2 Assert.Equal("localhost", name); -#elif NET461 - Assert.Null(name); -#else -#error TFMs need to be updated -#endif selectorCalled++; return _x509Certificate2; } diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj b/src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj index 0e665b5fcd..293b468728 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.2;net461 + netcoreapp3.0 true InMemory.FunctionalTests diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/ChromeTests.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/ChromeTests.cs index 1e402ba8bf..4c8551899c 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/ChromeTests.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/ChromeTests.cs @@ -1,8 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -#if NETCOREAPP2_2 - using System; using System.IO; using System.Net; @@ -135,8 +133,3 @@ namespace Interop.FunctionalTests } } } - -#elif NET461 // No ALPN support -#else -#error TFMs need updating -#endif diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/Interop.FunctionalTests.csproj b/src/Servers/Kestrel/test/Interop.FunctionalTests/Interop.FunctionalTests.csproj index acfdb652fe..b420aac5f5 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/Interop.FunctionalTests.csproj +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/Interop.FunctionalTests.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + netcoreapp3.0 true Interop.FunctionalTests CS8002;$(WarningsNotAsErrors) diff --git a/src/Servers/Kestrel/test/Libuv.BindTests/Libuv.BindTests.csproj b/src/Servers/Kestrel/test/Libuv.BindTests/Libuv.BindTests.csproj index 492ee2f12a..690d9f5d9b 100644 --- a/src/Servers/Kestrel/test/Libuv.BindTests/Libuv.BindTests.csproj +++ b/src/Servers/Kestrel/test/Libuv.BindTests/Libuv.BindTests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.2;net461 + netcoreapp3.0 true Libuv.BindTests diff --git a/src/Servers/Kestrel/test/Libuv.FunctionalTests/Libuv.FunctionalTests.csproj b/src/Servers/Kestrel/test/Libuv.FunctionalTests/Libuv.FunctionalTests.csproj index 70253c4aba..30392ae11e 100644 --- a/src/Servers/Kestrel/test/Libuv.FunctionalTests/Libuv.FunctionalTests.csproj +++ b/src/Servers/Kestrel/test/Libuv.FunctionalTests/Libuv.FunctionalTests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.2;net461 + netcoreapp3.0 $(DefineConstants);MACOS true diff --git a/src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj b/src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj index cabf3e90b0..b0622e4eb3 100644 --- a/src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj +++ b/src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.2;net461 + netcoreapp3.0 true Sockets.BindTests diff --git a/src/Servers/Kestrel/test/Sockets.FunctionalTests/Sockets.FunctionalTests.csproj b/src/Servers/Kestrel/test/Sockets.FunctionalTests/Sockets.FunctionalTests.csproj index b297d34d66..56a6b3c42e 100644 --- a/src/Servers/Kestrel/test/Sockets.FunctionalTests/Sockets.FunctionalTests.csproj +++ b/src/Servers/Kestrel/test/Sockets.FunctionalTests/Sockets.FunctionalTests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.2;net461 + netcoreapp3.0 $(DefineConstants);MACOS true Sockets.FunctionalTests diff --git a/src/Servers/Kestrel/tools/CodeGenerator/CodeGenerator.csproj b/src/Servers/Kestrel/tools/CodeGenerator/CodeGenerator.csproj index d4c557726d..634bac96d1 100644 --- a/src/Servers/Kestrel/tools/CodeGenerator/CodeGenerator.csproj +++ b/src/Servers/Kestrel/tools/CodeGenerator/CodeGenerator.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.2 + netcoreapp3.0 Exe false true