Skip to content

Remove AOT conditional exclusions for SignalR and delete deprecated methods#403

Merged
JusterZhu merged 2 commits into
masterfrom
fix/remove-aot-signalr-exclusions-and-deprecated-methods
May 25, 2026
Merged

Remove AOT conditional exclusions for SignalR and delete deprecated methods#403
JusterZhu merged 2 commits into
masterfrom
fix/remove-aot-signalr-exclusions-and-deprecated-methods

Conversation

@JusterZhu
Copy link
Copy Markdown
Collaborator

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

  • Remove #define AOT constant
  • Remove Condition="'$(PublishAot)' != 'true'" from 3 SignalR.Client PackageReference entries
  • Remove 3 <Compile Remove> entries for AOT exclusion (Hubs/*.cs, HubDownloadSource.cs, SilentPollOrchestrator.cs)

GeneralUpdateBootstrap.cs

  • Remove #if !AOT / #endif around HubDownloadSource initialization
  • Remove #if !AOT / #else / #endif around LaunchSilentAsync method body
  • Delete 3 deprecated override methods (StrategyFactory, ExecuteStrategyAsync, ExecuteStrategy)

AbstractBootstrap.cs

  • Delete 3 deprecated abstract methods (ExecuteStrategy, ExecuteStrategyAsync, StrategyFactory)

Closes #402

…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
Copilot AI review requested due to automatic review settings May 25, 2026 07:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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 AOT conditional compilation constant and AOT-specific Compile Remove exclusions for Hub/Silent polling code.
  • Removes PublishAot-conditioned exclusions on Microsoft.AspNetCore.SignalR.Client package references.
  • Deletes deprecated abstract methods in AbstractBootstrap and corresponding (unused) overrides in GeneralUpdateBootstrap.

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
@JusterZhu JusterZhu merged commit 06e8f47 into master May 25, 2026
3 checks passed
@JusterZhu JusterZhu deleted the fix/remove-aot-signalr-exclusions-and-deprecated-methods branch May 25, 2026 07:37
@JusterZhu JusterZhu restored the fix/remove-aot-signalr-exclusions-and-deprecated-methods branch May 25, 2026 07:37
@JusterZhu JusterZhu deleted the fix/remove-aot-signalr-exclusions-and-deprecated-methods branch May 25, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove AOT conditional exclusions for SignalR and delete deprecated methods

2 participants