Skip to content

Add NativeAOT support for the Blazor Gateway CLI - #68588

Draft
javiercn wants to merge 2 commits into
mainfrom
javiercn/gateway-cli-nativeaot
Draft

Add NativeAOT support for the Blazor Gateway CLI#68588
javiercn wants to merge 2 commits into
mainfrom
javiercn/gateway-cli-nativeaot

Conversation

@javiercn

Copy link
Copy Markdown
Member

Summary

  • convert Microsoft.AspNetCore.Components.Gateway.Cli into a first-class executable .NET tool
  • publish RID-specific NativeAOT tool packages for supported CoreCLR platforms, with an any framework-dependent fallback for source-build, Mono, and unsupported platforms
  • preserve Gateway health checks, client configuration, static assets, YARP/service discovery, HTTPS, OpenTelemetry/OTLP, HTTP activity propagation, and the existing fallback runtime roll-forward policy
  • add installed-tool coverage for package selection, native execution, disabled dynamic code, fallback execution, and Gateway behavior

Stage gate

Directional local win-x64 measurements:

Metric Framework-dependent NativeAOT Result
Steady-state working set 88,403,968 B 43,868,160 B 50.4% lower
Median startup to /alive 594.50 ms 689.35 ms NativeAOT slower
Median proxy throughput 593.90 req/s 575.03 req/s 3.2% lower

The gate passed on working-set reduction while proxy throughput remained within the required 5%. NativeAOT publishing produced no trimming or AOT warnings.

Final local packages:

  • pointer: 11,390 B
  • any: 2,315,668 B
  • win-x64: 11,792,264 B, excluding debug symbols

Validation

  • dotnet pack .\src\Components\Gateway\cli\Microsoft.AspNetCore.Components.Gateway.Cli.csproj -c Release
  • dotnet test .\src\Components\Gateway\test\Microsoft.AspNetCore.Components.Gateway.Tests.csproj --no-restore -c Release --filter "FullyQualifiedName~Microsoft.AspNetCore.Components.Gateway" — 32 passed
  • installed the top-level package and ran the selected win-x64 native tool with dynamic code disabled
  • produced and installed the Mono/source-build-style pointer + any fallback, ran --info, and verified /alive returns 200

Cross-platform follow-up

Official CI still needs to validate native execution and RID selection across Linux/glibc, Linux/musl, macOS, Windows x86, and Windows arm64; Unix execute permissions; macOS signing/notarization; and native symbol harvesting.

Copilot AI added 2 commits August 17, 2026 14:50
Package the Blazor Gateway CLI as RID-specific NativeAOT tools with a framework-dependent fallback, and validate installed package behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the framework-dependent tool's cross-major runtime roll-forward policy and terminate timed-out test tool processes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1505127b-29c1-4548-bef2-dfb7afd593fb
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.

2 participants