diff --git a/global.json b/global.json index e68e4a5387b6e43d41f2fa3b634ac89a3db53de6..302c5825ab9b8e52c7b3407df26ce11d421217a1 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { "sdk": { - "version": "6.0.100-rc.2.21457.23" + "version": "6.0.100-rc.2.21470.55" }, "tools": { - "dotnet": "6.0.100-rc.2.21457.23", + "dotnet": "6.0.100-rc.2.21470.55", "runtimes": { "dotnet/x64": [ "2.1.27", diff --git a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs index 92dd733318e873ed2908a5de08f87e2725388d2d..3452bd52d7a0e5e02fe820ee242b28ee85aa34b4 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs @@ -457,7 +457,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3 { var httpConnectionContext = new Http3StreamContext( _multiplexedContext.ConnectionId, +#pragma warning disable CA2252 // Preview Features HttpProtocols.Http3, +#pragma warning restore CA2252 _context.AltSvcHeader, _multiplexedContext, _context.ServiceContext, @@ -537,7 +539,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3 var streamContext = await _multiplexedContext.ConnectAsync(features); var httpConnectionContext = new Http3StreamContext( _multiplexedContext.ConnectionId, +#pragma warning disable CA2252 // Preview Features HttpProtocols.Http3, +#pragma warning restore CA2252 _context.AltSvcHeader, _multiplexedContext, _context.ServiceContext, diff --git a/src/Servers/Kestrel/Core/src/Internal/HttpConnection.cs b/src/Servers/Kestrel/Core/src/Internal/HttpConnection.cs index 09aeb663dbca7fdb5be67fb4160a4fff5ae00ece..ada579f7166667f43fa8b1f269e60dd93361bb46 100644 --- a/src/Servers/Kestrel/Core/src/Internal/HttpConnection.cs +++ b/src/Servers/Kestrel/Core/src/Internal/HttpConnection.cs @@ -70,8 +70,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal requestProcessor = new Http2Connection((HttpConnectionContext)_context); _protocolSelectionState = ProtocolSelectionState.Selected; break; +#pragma warning disable CA2252 // Preview Features case HttpProtocols.Http3: requestProcessor = new Http3Connection((HttpMultiplexedConnectionContext)_context); +#pragma warning restore CA2252 _protocolSelectionState = ProtocolSelectionState.Selected; break; case HttpProtocols.None: @@ -205,7 +207,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal var isMultiplexTransport = _context is HttpMultiplexedConnectionContext; var http1Enabled = _context.Protocols.HasFlag(HttpProtocols.Http1); var http2Enabled = _context.Protocols.HasFlag(HttpProtocols.Http2); +#pragma warning disable CA2252 // Preview Features var http3Enabled = _context.Protocols.HasFlag(HttpProtocols.Http3); +#pragma warning restore CA2252 string? error = null; @@ -218,7 +222,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal { if (http3Enabled) { +#pragma warning disable CA2252 // Preview Features return HttpProtocols.Http3; +#pragma warning restore CA2252 } error = $"Protocols {_context.Protocols} not supported on multiplexed transport."; diff --git a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/HttpUtilities.cs b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/HttpUtilities.cs index c908d39d203b9f496df2035de49ebd6237074c5a..1d52fd1dcf07bf3d516a2c0696601f172a7ccb56 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/HttpUtilities.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/HttpUtilities.cs @@ -536,7 +536,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure public static AltSvcHeader? GetEndpointAltSvc(System.Net.IPEndPoint endpoint, HttpProtocols protocols) { var hasHttp1OrHttp2 = protocols.HasFlag(HttpProtocols.Http1) || protocols.HasFlag(HttpProtocols.Http2); +#pragma warning disable CA2252 // Preview Features var hasHttp3 = protocols.HasFlag(HttpProtocols.Http3); +#pragma warning restore CA2252 if (hasHttp1OrHttp2 && hasHttp3) { diff --git a/src/Servers/Kestrel/Core/src/Internal/KestrelServerImpl.cs b/src/Servers/Kestrel/Core/src/Internal/KestrelServerImpl.cs index 7ff705c633aaae238a606d3eb973894de7f19cd0..a959dfdf7dc8a244af49beed3657f0445758b998 100644 --- a/src/Servers/Kestrel/Core/src/Internal/KestrelServerImpl.cs +++ b/src/Servers/Kestrel/Core/src/Internal/KestrelServerImpl.cs @@ -168,7 +168,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core { var hasHttp1 = options.Protocols.HasFlag(HttpProtocols.Http1); var hasHttp2 = options.Protocols.HasFlag(HttpProtocols.Http2); +#pragma warning disable CA2252 // Preview Features var hasHttp3 = options.Protocols.HasFlag(HttpProtocols.Http3); +#pragma warning restore CA2252 var hasTls = options.IsTls; // Filter out invalid combinations. diff --git a/src/Servers/Kestrel/Core/src/ListenOptionsHttpsExtensions.cs b/src/Servers/Kestrel/Core/src/ListenOptionsHttpsExtensions.cs index e5ed3575f8373b7489132c7d0e59c22660b69e3f..3307ebb25ba6ff4f7691fb28bc3d7f6753441da2 100644 --- a/src/Servers/Kestrel/Core/src/ListenOptionsHttpsExtensions.cs +++ b/src/Servers/Kestrel/Core/src/ListenOptionsHttpsExtensions.cs @@ -256,10 +256,12 @@ namespace Microsoft.AspNetCore.Hosting /// <returns>The <see cref="ListenOptions"/>.</returns> public static ListenOptions UseHttps(this ListenOptions listenOptions, ServerOptionsSelectionCallback serverOptionsSelectionCallback, object state, TimeSpan handshakeTimeout) { +#pragma warning disable CA2252 // Preview Features if (listenOptions.Protocols.HasFlag(HttpProtocols.Http3)) { throw new NotSupportedException($"{nameof(UseHttps)} with {nameof(ServerOptionsSelectionCallback)} is not supported with HTTP/3."); } +#pragma warning restore CA2252 return listenOptions.UseHttps(new TlsHandshakeCallbackOptions() { OnConnection = context => serverOptionsSelectionCallback(context.SslStream, context.ClientHelloInfo, context.State, context.CancellationToken), @@ -287,10 +289,12 @@ namespace Microsoft.AspNetCore.Hosting throw new ArgumentException($"{nameof(TlsHandshakeCallbackOptions.OnConnection)} must not be null."); } +#pragma warning disable CA2252 // Preview Features if (listenOptions.Protocols.HasFlag(HttpProtocols.Http3)) { throw new NotSupportedException($"{nameof(UseHttps)} with {nameof(TlsHandshakeCallbackOptions)} is not supported with HTTP/3."); } +#pragma warning restore CA2252 var loggerFactory = listenOptions.KestrelServerOptions?.ApplicationServices.GetRequiredService<ILoggerFactory>() ?? NullLoggerFactory.Instance; 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 8786fa6969eee2871d5de535210d7545c967a006..d03a06f449b300656e2ef6fb638c21c5ef530620 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 @@ -5,6 +5,7 @@ <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <TestGroupName>Kestrel.Core.Tests</TestGroupName> <DefineConstants>$(DefineConstants);KESTREL</DefineConstants> + <EnablePreviewFeatures>true</EnablePreviewFeatures> </PropertyGroup> <ItemGroup> diff --git a/src/Servers/Kestrel/Kestrel/src/WebHostBuilderKestrelExtensions.cs b/src/Servers/Kestrel/Kestrel/src/WebHostBuilderKestrelExtensions.cs index 0a008b0fd817654f23532a620b5feacf94f41e8b..568115cced9851e34be98abe203a4893e09e2ba3 100644 --- a/src/Servers/Kestrel/Kestrel/src/WebHostBuilderKestrelExtensions.cs +++ b/src/Servers/Kestrel/Kestrel/src/WebHostBuilderKestrelExtensions.cs @@ -29,7 +29,9 @@ namespace Microsoft.AspNetCore.Hosting /// </returns> public static IWebHostBuilder UseKestrel(this IWebHostBuilder hostBuilder) { +#pragma warning disable CA2252 // Preview Features hostBuilder.UseQuic(); +#pragma warning restore CA2252 return hostBuilder.ConfigureServices(services => { // Don't override an already-configured transport 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 ce2dd9d90cff5cacae4f378c19fbcb4397414707..1286a684ea9586f35ba9f84fdc2c8712ae15e992 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 @@ -2,6 +2,7 @@ <PropertyGroup> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> + <EnablePreviewFeatures>true</EnablePreviewFeatures> </PropertyGroup> <ItemGroup> 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 433253cee1cddef8bf57604454e84c88ffa38e47..94eadcf539cda3bb165d0c6fa2862458f198af1a 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 @@ -7,6 +7,7 @@ <!-- https://github.com/dotnet/aspnetcore/issues/22114 --> <SkipHelixArm>true</SkipHelixArm> <SkipHelixAlpine>true</SkipHelixAlpine> + <EnablePreviewFeatures>true</EnablePreviewFeatures> </PropertyGroup> <ItemGroup> diff --git a/src/Servers/Kestrel/Transport.Quic/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.csproj b/src/Servers/Kestrel/Transport.Quic/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.csproj index a1838ce726b8bddbec7d7fea74785c9bc7453b00..145612775bf88821d7721636db6df53c6e350047 100644 --- a/src/Servers/Kestrel/Transport.Quic/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.csproj +++ b/src/Servers/Kestrel/Transport.Quic/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.csproj @@ -7,9 +7,10 @@ <GenerateDocumentationFile>true</GenerateDocumentationFile> <PackageTags>aspnetcore;kestrel</PackageTags> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> - <NoWarn>CA1416;CS1591;CS0436;$(NoWarn)</NoWarn><!-- Conflicts between internal and public Quic APIs; Platform support warnings. --> + <NoWarn>CA1416;CS1591;CS0436;$(NoWarn)</NoWarn> <!-- Conflicts between internal and public Quic APIs; Platform support warnings. --> <IsPackable>false</IsPackable> <Nullable>enable</Nullable> + <EnablePreviewFeatures>True</EnablePreviewFeatures> <!-- System.Net.Quic is still in preview --> </PropertyGroup> <ItemGroup> diff --git a/src/Servers/Kestrel/Transport.Quic/test/Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests.csproj b/src/Servers/Kestrel/Transport.Quic/test/Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests.csproj index ca4fbc0ea84d7b206874d11b2a6c58b2ada38249..c0aca2c1111f14bcd0d82d05da2454abc0326bf2 100644 --- a/src/Servers/Kestrel/Transport.Quic/test/Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests.csproj +++ b/src/Servers/Kestrel/Transport.Quic/test/Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests.csproj @@ -4,6 +4,7 @@ <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <ServerGarbageCollection>true</ServerGarbageCollection> + <EnablePreviewFeatures>true</EnablePreviewFeatures> </PropertyGroup> <ItemGroup> diff --git a/src/Servers/Kestrel/perf/Microbenchmarks/Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks.csproj b/src/Servers/Kestrel/perf/Microbenchmarks/Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks.csproj index f7bfa926cc67a5623df8558b68d098960df1be2e..1f946d12ff041d2329cd87465d2d4882fd2dadf6 100644 --- a/src/Servers/Kestrel/perf/Microbenchmarks/Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks.csproj +++ b/src/Servers/Kestrel/perf/Microbenchmarks/Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks.csproj @@ -6,6 +6,7 @@ <ServerGarbageCollection>true</ServerGarbageCollection> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <TieredCompilation>false</TieredCompilation> + <EnablePreviewFeatures>true</EnablePreviewFeatures> </PropertyGroup> <ItemGroup> diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj b/src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj index da4ffb2ae380ab4cedb8bfaa8791fc222bee6e98..dfb01f84c5d8596922c31e7ab92150dcfaed4b30 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj @@ -6,6 +6,7 @@ <TestGroupName>InMemory.FunctionalTests</TestGroupName> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <DefineConstants>$(DefineConstants);IS_FUNCTIONAL_TESTS</DefineConstants> + <EnablePreviewFeatures>true</EnablePreviewFeatures> </PropertyGroup> <ItemGroup> diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/Interop.FunctionalTests.csproj b/src/Servers/Kestrel/test/Interop.FunctionalTests/Interop.FunctionalTests.csproj index d904a168c6eb0cee8cd00e7f41cda6451bc27b04..a8da39e1dd98e79f98e50c14c5f0bb0d40e8f932 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/Interop.FunctionalTests.csproj +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/Interop.FunctionalTests.csproj @@ -8,6 +8,7 @@ <SignAssembly>false</SignAssembly> <SkipHelixArm>true</SkipHelixArm> <SkipHelixAlpine>true</SkipHelixAlpine> + <EnablePreviewFeatures>true</EnablePreviewFeatures> </PropertyGroup> <ItemGroup> diff --git a/src/Servers/Kestrel/test/Libuv.BindTests/Libuv.BindTests.csproj b/src/Servers/Kestrel/test/Libuv.BindTests/Libuv.BindTests.csproj index 8874b5616433048758722dfaa71b2b42233ede21..b9597587bbfb413dc002ca28934758664d430fa3 100644 --- a/src/Servers/Kestrel/test/Libuv.BindTests/Libuv.BindTests.csproj +++ b/src/Servers/Kestrel/test/Libuv.BindTests/Libuv.BindTests.csproj @@ -6,6 +6,7 @@ <TestGroupName>Libuv.BindTests</TestGroupName> <!-- https://github.com/dotnet/aspnetcore/issues/22114 --> <SkipHelixQueues>Windows.10.Arm64;Windows.10.Arm64.Open;Windows.10.Arm64v8;Windows.10.Arm64v8.Open</SkipHelixQueues> + <EnablePreviewFeatures>true</EnablePreviewFeatures> </PropertyGroup> <ItemGroup> diff --git a/src/Servers/Kestrel/test/Libuv.FunctionalTests/Libuv.FunctionalTests.csproj b/src/Servers/Kestrel/test/Libuv.FunctionalTests/Libuv.FunctionalTests.csproj index 428143af300dac8dfb581130bd4c361bdd7c18a2..f252a148f244c4094e4e94ac9eca128ef7b4cab4 100644 --- a/src/Servers/Kestrel/test/Libuv.FunctionalTests/Libuv.FunctionalTests.csproj +++ b/src/Servers/Kestrel/test/Libuv.FunctionalTests/Libuv.FunctionalTests.csproj @@ -9,6 +9,7 @@ <TestGroupName>Libuv.FunctionalTests</TestGroupName> <!-- https://github.com/dotnet/aspnetcore/issues/22114 --> <SkipHelixQueues>Windows.10.Arm64;Windows.10.Arm64.Open;Windows.10.Arm64v8;Windows.10.Arm64v8.Open</SkipHelixQueues> + <EnablePreviewFeatures>true</EnablePreviewFeatures> </PropertyGroup> <ItemGroup> diff --git a/src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj b/src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj index 0f7576c452d98d70c2d53a4a203010682b6fc558..2a79d6e43158b66733a22f6d13f68326dc0587cc 100644 --- a/src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj +++ b/src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj @@ -4,6 +4,7 @@ <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <ServerGarbageCollection>true</ServerGarbageCollection> <TestGroupName>Sockets.BindTests</TestGroupName> + <EnablePreviewFeatures>true</EnablePreviewFeatures> </PropertyGroup> <ItemGroup> diff --git a/src/Servers/Kestrel/test/Sockets.FunctionalTests/Sockets.FunctionalTests.csproj b/src/Servers/Kestrel/test/Sockets.FunctionalTests/Sockets.FunctionalTests.csproj index d42ac6b661f83898123aff2535ff0bc2c46129c3..f64638d9806fc3c55300a7904b4ae2d154e360a8 100644 --- a/src/Servers/Kestrel/test/Sockets.FunctionalTests/Sockets.FunctionalTests.csproj +++ b/src/Servers/Kestrel/test/Sockets.FunctionalTests/Sockets.FunctionalTests.csproj @@ -6,6 +6,7 @@ <DefineConstants>$(DefineConstants);SOCKETS</DefineConstants> <ServerGarbageCollection>true</ServerGarbageCollection> <TestGroupName>Sockets.FunctionalTests</TestGroupName> + <EnablePreviewFeatures>true</EnablePreviewFeatures> </PropertyGroup> <ItemGroup>