diff --git a/src/Servers/Kestrel/Core/src/Adapter/Internal/AdaptedPipeline.cs b/src/Servers/Kestrel/Core/src/Adapter/Internal/AdaptedPipeline.cs index eb65aac253e2..4b591a717d58 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 @@ private async Task WriteOutputAsync(Stream stream) } 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 @@ private async Task ReadInputAsync(Stream stream) { 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 42722f24133a..d7d5e8559073 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 @@ public override int Read(byte[] buffer, int offset, int count) 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 @@ public async override Task ReadAsync(byte[] buffer, int offset, int count, 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 @@ public override void Write(byte[] buffer, int offset, int count) _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 @@ public override Task WriteAsync(byte[] buffer, int offset, int count, Cancellati 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 137b87ea0455..837bc8ec0598 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 @@ public override Task ReadAsync(byte[] buffer, int offset, int count, Cancel 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 @@ public override async Task WriteAsync(byte[] buffer, int offset, int count, Canc 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 3451bcdb303f..a160d9180e0c 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 @@ public override Task ReadAsync(byte[] buffer, int offset, int count, Cancel 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 79d31367c89e..2d50902e3169 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 @@ public override Task WriteAsync(byte[] buffer, int offset, int count, Cancellati 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 0b89d00ed132..4557e6609d8c 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 @@ public override Task ReadAsync(byte[] buffer, int offset, int count, Cancel 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 @@ public override Task WriteAsync(byte[] buffer, int offset, int count, Cancellati 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 750a49079375..30248cac50db 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 @@ protected MessageBody(HttpProtocol context, MinDataRate minRequestBodyDataRate) // 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 4abeabc80afd..5b365c9bc332 100644 --- a/src/Servers/Kestrel/Core/src/Internal/HttpsConnectionAdapter.cs +++ b/src/Servers/Kestrel/Core/src/Internal/HttpsConnectionAdapter.cs @@ -131,7 +131,6 @@ private async Task InnerOnConnectionAsync(ConnectionAdapterC try { -#if NETCOREAPP2_1 // Adapt to the SslStream signature ServerCertificateSelectionCallback selector = null; if (_serverCertificateSelector != null) @@ -172,22 +171,6 @@ private async Task InnerOnConnectionAsync(ConnectionAdapterC } 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 @@ await sslStream.AuthenticateAsServerAsync(serverCert, certificateRequired, 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 0be1c97d7e60..6f1b13c39b1a 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 @@ public override int Read(byte[] buffer, int offset, int count) 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 @@ public override void Write(byte[] buffer, int offset, int count) 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 90d916537e6b..04fd9fff4f73 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 a9b0f9726808..ee3c21a042cf 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 @@ public async Task WriteAsyncThrows() 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 1ba8b542d19c..1db176d5eb8a 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 60e282fe8272..7394ffae0029 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 e561f0cc213b..f91bee1dd6e8 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 @@ public void GeneratedCodeIsUpToDate() } } } -#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 ab8048acb881..1a91bad913eb 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 e6d51dac8f05..39c53a73ff7b 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 001e97cdb6b4..b7b4f6d53e2f 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 17c05a6cd729..bb263e89a3fd 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 3c3451cbcc8c..1888ab87551c 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 @@ public SocketReceiver(Socket socket, PipeScheduler scheduler) : base(socket, sch 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 @@ public SocketAwaitableEventArgs WaitForDataAsync() 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 4dba6aedb4ce..62583df05d7e 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 @@ public SocketAwaitableEventArgs SendAsync(ReadOnlySequence buffers) 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 @@ private SocketAwaitableEventArgs SendAsync(ReadOnlyMemory memory) _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 82dde8daa864..2df07062fd25 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 8b6637c1d62c..09655f7ca8fd 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 4460a67388f1..a1895bec473d 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 b367dd576ab2..c7eb03c2c1c6 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 6d4786c5b5bf..976d4df073d0 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 6d4786c5b5bf..976d4df073d0 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 9e8a0e6269cd..1e7a08eff73e 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 41aa0ed7835c..b651cc6cf974 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 351a2c9e93f3..9f81ceec5fd0 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 @@ public override void Close() _innerStream.Close(); } -#if NETCOREAPP2_2 public override int Read(Span buffer) { return _innerStream.Read(buffer); @@ -165,10 +164,6 @@ public override void CopyTo(Stream destination, int bufferSize) { _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 0b81846e92ae..446be393dcaf 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 @@ public async Task TlsAlpnHandshakeSelectsHttp2() } } } -#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 d1f06974e6e0..cb7c5a1ee4f9 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 @@ public async Task GracefulTurnsAbortiveIfRequestsDoNotFinish() } } } -#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 f366f1dd0fcf..85c05798a6c9 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 @@ private async Task ReceiveFrameAsync(PipeReader reader) } } } -#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 572e717b801d..ae9434642d3f 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionAdapterTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionAdapterTests.cs @@ -182,13 +182,7 @@ public async Task UsesProvidedServerCertificateSelector() { 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 @@ public async Task UsesProvidedServerCertificateSelectorEachTime() { 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 @@ public async Task UsesProvidedServerCertificateSelectorOverridesServerCertificat { 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 0e665b5fcd81..293b468728b0 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 1e402ba8bfbc..4c8551899ce5 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 @@ private void AssertExpectedResponseOrShowDebugInstructions(string expectedRespon } } } - -#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 acfdb652fe67..b420aac5f5ab 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 492ee2f12a06..690d9f5d9b2e 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 70253c4aba02..30392ae11ee3 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 cabf3e90b0f8..b0622e4eb3ad 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 b297d34d66d4..56a6b3c42e3d 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 d4c557726de4..634bac96d187 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