Skip to content

Mark another 27 projects as AOT compatible#9704

Merged
glen-84 merged 2 commits into
mainfrom
gai/aot-compatibility
May 15, 2026
Merged

Mark another 27 projects as AOT compatible#9704
glen-84 merged 2 commits into
mainfrom
gai/aot-compatibility

Conversation

@glen-84

@glen-84 glen-84 commented May 14, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 14, 2026 14:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 via Directory.Build.props).
  • Centralize IsAotCompatible for PersistedOperations projects into src/HotChocolate/PersistedOperations/src/Directory.Build.props.
  • Add DynamicallyAccessedMembers(PublicConstructors) annotations for generic DI registration extension methods and remove RequiresDynamicCode/RequiresUnreferencedCode attributes 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.

@glen-84 glen-84 merged commit edef526 into main May 15, 2026
141 of 142 checks passed
@glen-84 glen-84 deleted the gai/aot-compatibility branch May 15, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants