From 17274822a8d7cc36c2c4363111ab1cd5d75fefd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20N=C3=A4geli?= Date: Wed, 2 Sep 2026 17:12:26 +0200 Subject: [PATCH 1/6] Enable runtime-async on all libraries --- Directory.Build.props | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index 5a497e18..5b59c502 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,6 +4,8 @@ net10.0;net11.0 + $(Features);runtime-async=on + 14.0 enable true From d68d9019182109127a37cab83cd5f889200bdad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20N=C3=A4geli?= Date: Wed, 2 Sep 2026 17:17:32 +0200 Subject: [PATCH 2/6] Remove no longer needed warning supressions --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 5b59c502..0f36cd08 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ true true - CS1591,CS1587,CS1572,CS1573,NU1510 + CS1591,CS1572,CS1573 From 9620563d2e158581131d60ab1a7907879f67c198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20N=C3=A4geli?= Date: Wed, 2 Sep 2026 17:21:45 +0200 Subject: [PATCH 3/6] Opt out of runtime-async for UnwrapAsync() --- Directory.Build.props | 2 +- Modules/Reflection/MethodHandler.cs | 4 ++- .../RuntimeAsyncMethodGenerationAttribute.cs | 31 +++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 Modules/Reflection/RuntimeAsyncMethodGenerationAttribute.cs diff --git a/Directory.Build.props b/Directory.Build.props index 0f36cd08..b3f545ae 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -42,7 +42,7 @@ - + diff --git a/Modules/Reflection/MethodHandler.cs b/Modules/Reflection/MethodHandler.cs index 435bd2a2..e22956e8 100644 --- a/Modules/Reflection/MethodHandler.cs +++ b/Modules/Reflection/MethodHandler.cs @@ -1,5 +1,6 @@ using System.Reflection; using System.Runtime.ExceptionServices; +using System.Runtime.CompilerServices; using Cottle; @@ -235,7 +236,8 @@ public ValueTask PrepareAsync(IServer server) throw; } } - + + [RuntimeAsyncMethodGenerationAttribute(false)] private static async ValueTask UnwrapAsync(object? result) { if (result == null) diff --git a/Modules/Reflection/RuntimeAsyncMethodGenerationAttribute.cs b/Modules/Reflection/RuntimeAsyncMethodGenerationAttribute.cs new file mode 100644 index 00000000..d4b0b2d7 --- /dev/null +++ b/Modules/Reflection/RuntimeAsyncMethodGenerationAttribute.cs @@ -0,0 +1,31 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// ReSharper disable once CheckNamespace +namespace System.Runtime.CompilerServices; + +/// +/// Controls whether runtime-generated async code is used for an async method. +/// +[AttributeUsage(AttributeTargets.Method, Inherited = false)] +public sealed class RuntimeAsyncMethodGenerationAttribute : Attribute +{ + + /// + /// Initializes a new instance of the class. + /// + /// + /// true to enable runtime async generation for the attributed method; + /// false to disable it. + /// + public RuntimeAsyncMethodGenerationAttribute(bool enabled) + { + Enabled = enabled; + } + + /// + /// Gets whether runtime async generation is enabled. + /// + public bool Enabled { get; } + +} From 7db74a10c6983cad250134d13e3b5ee5034acad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20N=C3=A4geli?= Date: Wed, 2 Sep 2026 17:22:13 +0200 Subject: [PATCH 4/6] Update nuget packages --- API/GenHTTP.Api.csproj | 2 +- Engine/Internal/GenHTTP.Engine.Internal.csproj | 4 ++-- Engine/Ioxide/GenHTTP.Engine.Ioxide.csproj | 2 +- Engine/Shared/GenHTTP.Engine.Shared.csproj | 4 ++-- .../GenHTTP.Generators.MemoryView.csproj | 4 ++-- Modules/Archives/GenHTTP.Modules.Archives.csproj | 2 +- .../GenHTTP.Modules.DependencyInjection.csproj | 2 +- Modules/Protobuf/GenHTTP.Modules.Protobuf.csproj | 2 +- .../Reflection/GenHTTP.Modules.Reflection.csproj | 2 +- .../Acceptance/GenHTTP.Testing.Acceptance.csproj | 16 ++++++++-------- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/API/GenHTTP.Api.csproj b/API/GenHTTP.Api.csproj index e9962c5a..8e4b6f98 100644 --- a/API/GenHTTP.Api.csproj +++ b/API/GenHTTP.Api.csproj @@ -16,7 +16,7 @@ - + diff --git a/Engine/Internal/GenHTTP.Engine.Internal.csproj b/Engine/Internal/GenHTTP.Engine.Internal.csproj index 6a3f0e0b..0661f82e 100644 --- a/Engine/Internal/GenHTTP.Engine.Internal.csproj +++ b/Engine/Internal/GenHTTP.Engine.Internal.csproj @@ -16,9 +16,9 @@ - + - + diff --git a/Engine/Ioxide/GenHTTP.Engine.Ioxide.csproj b/Engine/Ioxide/GenHTTP.Engine.Ioxide.csproj index 59680062..4170201e 100644 --- a/Engine/Ioxide/GenHTTP.Engine.Ioxide.csproj +++ b/Engine/Ioxide/GenHTTP.Engine.Ioxide.csproj @@ -12,7 +12,7 @@ - + diff --git a/Engine/Shared/GenHTTP.Engine.Shared.csproj b/Engine/Shared/GenHTTP.Engine.Shared.csproj index fc8377e5..e5e72df8 100644 --- a/Engine/Shared/GenHTTP.Engine.Shared.csproj +++ b/Engine/Shared/GenHTTP.Engine.Shared.csproj @@ -14,9 +14,9 @@ - + - + diff --git a/Generators/MemoryView/GenHTTP.Generators.MemoryView.csproj b/Generators/MemoryView/GenHTTP.Generators.MemoryView.csproj index 3e43b2c6..ae1550c3 100644 --- a/Generators/MemoryView/GenHTTP.Generators.MemoryView.csproj +++ b/Generators/MemoryView/GenHTTP.Generators.MemoryView.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/Modules/Archives/GenHTTP.Modules.Archives.csproj b/Modules/Archives/GenHTTP.Modules.Archives.csproj index d7a4358b..cf13ff37 100644 --- a/Modules/Archives/GenHTTP.Modules.Archives.csproj +++ b/Modules/Archives/GenHTTP.Modules.Archives.csproj @@ -14,7 +14,7 @@ - + diff --git a/Modules/DependencyInjection/GenHTTP.Modules.DependencyInjection.csproj b/Modules/DependencyInjection/GenHTTP.Modules.DependencyInjection.csproj index 86782664..48cf1174 100644 --- a/Modules/DependencyInjection/GenHTTP.Modules.DependencyInjection.csproj +++ b/Modules/DependencyInjection/GenHTTP.Modules.DependencyInjection.csproj @@ -29,7 +29,7 @@ - + diff --git a/Modules/Protobuf/GenHTTP.Modules.Protobuf.csproj b/Modules/Protobuf/GenHTTP.Modules.Protobuf.csproj index cd18bdc7..d5c4a727 100644 --- a/Modules/Protobuf/GenHTTP.Modules.Protobuf.csproj +++ b/Modules/Protobuf/GenHTTP.Modules.Protobuf.csproj @@ -16,7 +16,7 @@ - + diff --git a/Modules/Reflection/GenHTTP.Modules.Reflection.csproj b/Modules/Reflection/GenHTTP.Modules.Reflection.csproj index 81d533d5..7bb9c1cd 100644 --- a/Modules/Reflection/GenHTTP.Modules.Reflection.csproj +++ b/Modules/Reflection/GenHTTP.Modules.Reflection.csproj @@ -18,7 +18,7 @@ - + diff --git a/Testing/Acceptance/GenHTTP.Testing.Acceptance.csproj b/Testing/Acceptance/GenHTTP.Testing.Acceptance.csproj index c0a97d63..4b9a2cff 100644 --- a/Testing/Acceptance/GenHTTP.Testing.Acceptance.csproj +++ b/Testing/Acceptance/GenHTTP.Testing.Acceptance.csproj @@ -44,20 +44,20 @@ - + - + - + - + - - + + - + all @@ -66,7 +66,7 @@ - + From 573b174a0cadc1f08a188464ae42d7246927abe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20N=C3=A4geli?= Date: Wed, 2 Sep 2026 17:33:53 +0200 Subject: [PATCH 5/6] Set the analyzer to 5.8 to be able to build again --- Generators/MemoryView/GenHTTP.Generators.MemoryView.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Generators/MemoryView/GenHTTP.Generators.MemoryView.csproj b/Generators/MemoryView/GenHTTP.Generators.MemoryView.csproj index ae1550c3..c2691ee9 100644 --- a/Generators/MemoryView/GenHTTP.Generators.MemoryView.csproj +++ b/Generators/MemoryView/GenHTTP.Generators.MemoryView.csproj @@ -13,8 +13,8 @@ - - + + From 3bcf497a0d51776bb9be496fce18ce210eb8ca80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20N=C3=A4geli?= Date: Wed, 2 Sep 2026 17:36:08 +0200 Subject: [PATCH 6/6] Back to old references --- Generators/MemoryView/GenHTTP.Generators.MemoryView.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Generators/MemoryView/GenHTTP.Generators.MemoryView.csproj b/Generators/MemoryView/GenHTTP.Generators.MemoryView.csproj index c2691ee9..3e43b2c6 100644 --- a/Generators/MemoryView/GenHTTP.Generators.MemoryView.csproj +++ b/Generators/MemoryView/GenHTTP.Generators.MemoryView.csproj @@ -13,8 +13,8 @@ - - + +