Mark another 27 projects as AOT compatible#9704
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands native AOT support signaling across the HotChocolate codebase by marking additional packages as AOT compatible, while tightening trimming/AOT annotations on DI-based extension points and removing now-unnecessary AOT warning attributes from ASP.NET Core pipeline components.
Changes:
- Mark additional projects as AOT compatible via
IsAotCompatible=true(per-project or viaDirectory.Build.props). - Centralize
IsAotCompatiblefor PersistedOperations projects intosrc/HotChocolate/PersistedOperations/src/Directory.Build.props. - Add
DynamicallyAccessedMembers(PublicConstructors)annotations for generic DI registration extension methods and removeRequiresDynamicCode/RequiresUnreferencedCodeattributes from several ASP.NET Core middleware types/methods.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/HotChocolate/Spatial/src/Types/HotChocolate.Types.Spatial.csproj | Marks Spatial types package as AOT compatible. |
| src/HotChocolate/Spatial/src/Data/HotChocolate.Data.Spatial.csproj | Marks Spatial data integration package as AOT compatible. |
| src/HotChocolate/PersistedOperations/src/PersistedOperations.Pipeline/HotChocolate.PersistedOperations.Pipeline.csproj | Removes per-project AOT flag in favor of centralized props. |
| src/HotChocolate/PersistedOperations/src/PersistedOperations.Abstractions/HotChocolate.PersistedOperations.Abstractions.csproj | Removes per-project AOT flag in favor of centralized props. |
| src/HotChocolate/PersistedOperations/src/Directory.Build.props | Centralizes IsAotCompatible for PersistedOperations projects. |
| src/HotChocolate/MongoDb/src/Types/HotChocolate.Types.MongoDb.csproj | Marks MongoDB types package as AOT compatible. |
| src/HotChocolate/Diagnostics/src/Directory.Build.props | Marks Diagnostics projects under this directory as AOT compatible. |
| src/HotChocolate/CostAnalysis/src/CostAnalysis/HotChocolate.CostAnalysis.csproj | Marks CostAnalysis package as AOT compatible. |
| src/HotChocolate/Core/src/Types.Scalars/HotChocolate.Types.Scalars.csproj | Marks Scalars package as AOT compatible. |
| src/HotChocolate/Core/src/Types.Scalars.Upload/HotChocolate.Types.Scalars.Upload.csproj | Marks Upload scalar package as AOT compatible. |
| src/HotChocolate/Core/src/Types.Queries/HotChocolate.Types.Queries.csproj | Marks Queries helpers package as AOT compatible. |
| src/HotChocolate/Core/src/Types.NodaTime/HotChocolate.Types.NodaTime.csproj | Marks NodaTime types package as AOT compatible. |
| src/HotChocolate/Core/src/Types.Mutations/HotChocolate.Types.Mutations.csproj | Marks Mutations helpers package as AOT compatible. |
| src/HotChocolate/Core/src/Types.Json/HotChocolate.Types.Json.csproj | Marks JSON types package as AOT compatible. |
| src/HotChocolate/Core/src/Types.CursorPagination.Extensions/HotChocolate.Types.CursorPagination.Extensions.csproj | Marks cursor pagination extensions as AOT compatible. |
| src/HotChocolate/Core/src/Subscriptions.InMemory/HotChocolate.Subscriptions.InMemory.csproj | Marks in-memory subscriptions package as AOT compatible. |
| src/HotChocolate/Core/src/Core/HotChocolate.Core.csproj | Marks core execution engine package as AOT compatible. |
| src/HotChocolate/Core/src/Authorization/HotChocolate.Authorization.csproj | Marks authorization package as AOT compatible. |
| src/HotChocolate/Core/src/Authorization/Extensions/AuthorizeRequestExecutorBuilder.cs | Adds trimming annotations to preserve constructors for DI-created authorization handlers. |
| src/HotChocolate/Caching/src/Directory.Build.props | Marks Caching projects under this directory as AOT compatible. |
| src/HotChocolate/AzureFunctions/src/Directory.Build.props | Marks AzureFunctions projects under this directory as AOT compatible. |
| src/HotChocolate/AspNetCore/src/AspNetCore/HotChocolate.AspNetCore.csproj | Marks ASP.NET Core integration package as AOT compatible. |
| src/HotChocolate/AspNetCore/src/AspNetCore/Extensions/HotChocolateAspNetCoreServiceCollectionExtensions.Subscriptions.cs | Adds trimming annotations to preserve constructors for DI-created socket/session related services. |
| src/HotChocolate/AspNetCore/src/AspNetCore/Extensions/HotChocolateAspNetCoreServiceCollectionExtensions.Http.cs | Adds trimming annotations to preserve constructors for DI-created HTTP interceptors/formatters. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/WebSocketSubscriptionMiddleware.cs | Removes RequiresDynamicCode/RequiresUnreferencedCode attributes from middleware type. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Utilities/MiddlewareHelper.cs | Removes RequiresDynamicCode/RequiresUnreferencedCode attributes from request execution helper. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Subscriptions/WebSocketSession.cs | Removes conditional Requires* annotations from WebSocket session type. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Subscriptions/OperationSession.cs | Removes conditional Requires* annotations from operation session type. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Subscriptions/OperationManager.cs | Removes conditional Requires* annotations from operation manager type. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/MiddlewareFactory.cs | Removes conditional Requires* annotations from middleware factory type. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/HttpPostMiddlewareBase.cs | Removes conditional Requires* annotations from base POST middleware type. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/HttpPostMiddleware.cs | Removes conditional Requires* annotations from POST middleware type. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/HttpMultipartMiddleware.cs | Removes conditional Requires* annotations from multipart middleware type. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/HttpGetMiddleware.cs | Removes conditional Requires* annotations from GET middleware type. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/ExecutorSession.cs | Removes conditional Requires* annotations from request execution methods. |
| src/HotChocolate/AspNetCore/src/AspNetCore.CommandLine/HotChocolate.AspNetCore.CommandLine.csproj | Marks command-line extensions package as AOT compatible. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Authorization/HotChocolate.AspNetCore.Authorization.csproj | Marks ASP.NET Core authorization integration package as AOT compatible. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced May 20, 2026
This was referenced May 27, 2026
This was referenced Jun 4, 2026
This was referenced Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.