diff --git a/src/Http/Http.Extensions/src/RequestDelegateFactory.cs b/src/Http/Http.Extensions/src/RequestDelegateFactory.cs index d86e3a48a820..95d5aa1f8d3d 100644 --- a/src/Http/Http.Extensions/src/RequestDelegateFactory.cs +++ b/src/Http/Http.Extensions/src/RequestDelegateFactory.cs @@ -99,13 +99,7 @@ public static partial class RequestDelegateFactory // but users still need to assert on it as in https://github.com/dotnet/aspnetcore/issues/45063 // so we temporarily work around this here by using reflection to get the actual type. private static readonly object? EmptyHttpResultInstance = Type.GetType("Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult, Microsoft.AspNetCore.Http.Results")?.GetProperty("Instance")?.GetValue(null, null); -#if DEBUG - private static readonly NewExpression EmptyHttpResultValueTaskExpr = EmptyHttpResultInstance is not null - ? Expression.New(typeof(ValueTask).GetConstructor(new[] { typeof(IResult) })!, Expression.Constant(EmptyHttpResultInstance)) - : throw new UnreachableException("The EmptyHttpResult type could not be found."); -#else private static readonly NewExpression EmptyHttpResultValueTaskExpr = Expression.New(typeof(ValueTask).GetConstructor(new[] { typeof(IResult) })!, Expression.Constant(EmptyHttpResultInstance)); -#endif private static readonly ParameterExpression TempSourceStringExpr = ParameterBindingMethodCache.TempSourceStringExpr; private static readonly BinaryExpression TempSourceStringNotNullExpr = Expression.NotEqual(TempSourceStringExpr, Expression.Constant(null)); private static readonly BinaryExpression TempSourceStringNullExpr = Expression.Equal(TempSourceStringExpr, Expression.Constant(null)); diff --git a/src/Http/Routing/test/UnitTests/Microsoft.AspNetCore.Routing.Tests.csproj b/src/Http/Routing/test/UnitTests/Microsoft.AspNetCore.Routing.Tests.csproj index b184a2f3a01d..f8fc0e5dbb31 100644 --- a/src/Http/Routing/test/UnitTests/Microsoft.AspNetCore.Routing.Tests.csproj +++ b/src/Http/Routing/test/UnitTests/Microsoft.AspNetCore.Routing.Tests.csproj @@ -8,6 +8,7 @@ +