Remove AOT conditional exclusions for SignalR and delete deprecated methods#403
Merged
JusterZhu merged 2 commits intoMay 25, 2026
Merged
Conversation
…ethods - Remove #define AOT constant and SignalR Compile Remove entries from csproj - Remove Condition on SignalR.Client PackageReference for AOT builds - Remove #if !AOT blocks in GeneralUpdateBootstrap.cs (HubDownloadSource + LaunchSilentAsync) - Delete deprecated abstract/override methods (ExecuteStrategy, ExecuteStrategyAsync, StrategyFactory) Closes #402
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes Native AOT conditional exclusions around SignalR/Hub functionality in GeneralUpdate.Core now that SignalR client supports Native AOT with the JSON protocol, and it deletes deprecated strategy-related abstract/override methods that were no longer used.
Changes:
- Removes the
AOTconditional compilation constant and AOT-specificCompile Removeexclusions for Hub/Silent polling code. - Removes
PublishAot-conditioned exclusions onMicrosoft.AspNetCore.SignalR.Clientpackage references. - Deletes deprecated abstract methods in
AbstractBootstrapand corresponding (unused) overrides inGeneralUpdateBootstrap.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/c#/GeneralUpdate.Core/GeneralUpdate.Core.csproj |
Removes AOT-specific constants/exclusions and makes SignalR references unconditional per TFM. |
src/c#/GeneralUpdate.Core/Configuration/AbstractBootstrap.cs |
Removes deprecated protected abstract strategy methods. |
src/c#/GeneralUpdate.Core/Bootstrap/GeneralUpdateBootstrap.cs |
Removes AOT conditionals around Hub download source and silent mode; deletes deprecated overrides. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -26,9 +26,6 @@ protected internal AbstractBootstrap() | |||
| } | |||
|
|
|||
| public abstract Task<TBootstrap> LaunchAsync(); | |||
Comment on lines
37
to
41
| <ItemGroup> | ||
| <!-- IsExternalInit is built-in for net8.0+ (C# 9 records) --> | ||
| <Compile Remove="Configuration\IsExternalInit.cs" Condition="'$(TargetFramework)' != 'netstandard2.0'" /> | ||
| <!-- SignalR Hub code excluded in AOT builds --> | ||
| <Compile Remove="Hubs\*.cs" Condition="'$(PublishAot)' == 'true'" /> | ||
| <Compile Remove="Download\Sources\HubDownloadSource.cs" Condition="'$(PublishAot)' == 'true'" /> | ||
| <Compile Remove="Silent\SilentPollOrchestrator.cs" Condition="'$(PublishAot)' == 'true'" /> | ||
|
|
||
| </ItemGroup> |
Comment on lines
96
to
100
| // Resolve DownloadSource from extension registry (Hub, custom, etc.) | ||
| var resolvedSource = ResolveExtension<Download.Abstractions.IDownloadSource>(); | ||
|
|
||
| // Inject SignalR Hub download source if configured (not available in AOT) | ||
| #if !AOT | ||
| // Inject SignalR Hub download source if configured | ||
| if (resolvedSource == null) |
- Add PacketDTO to HttpParameterJsonContext for source-generated AOT deserialization - Replace reflection-based Deserialize<PacketDTO> with source-gen version in HubDownloadSource - Remove try/catch in UpgradeHubService.StartAsync so hub connection failures propagate
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.
Summary
SignalR Client supports Native AOT (confirmed by dotnet/aspnetcore#59133). The requirement is using JSON protocol + registering JsonSerializerContext — which UpgradeHubService already does. Therefore all AOT conditional exclusions for SignalR/Hubs/SilentPoll are unnecessary.
Also removes deprecated abstract methods in AbstractBootstrap that are never invoked.
Changes
csproj
#define AOTconstantCondition="'$(PublishAot)' != 'true'"from 3 SignalR.Client PackageReference entries<Compile Remove>entries for AOT exclusion (Hubs/*.cs, HubDownloadSource.cs, SilentPollOrchestrator.cs)GeneralUpdateBootstrap.cs
#if !AOT/#endifaround HubDownloadSource initialization#if !AOT/#else/#endifaround LaunchSilentAsync method bodyAbstractBootstrap.cs
Closes #402