Repository navigation
Open
Feature
0 / 20 of 2 issues completed
Copy link
Labels
NativeAOTPillar: Technical DebtPriority:1Work that is critical for the release, but we could probably ship withoutarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onetriaged
Milestone
Description
There are several issues around this topic, and none are very explicit.
This issue will track the work we need to do to make this happen.
AoT has become an important tech across the industry, with emphasis on cloud scenarios, performance and "leanness". As such, it's interesting for Blazor Applications (a subset at least) to be able to be compiled ahead of time.
AoT opens the door to new scenarios, such as:
- Running on devices with heavy constraints (e.g. IoT)
- Running on devices with constrained sandboxes (e.g. iOS). While .NET runs in these devices today, Native AOT is a guarantee that we can run anywhere.
- Providing Web Based UIs for CLI tools (e.g. dotnet tools).
It also enhances Blazor's ability to run on existing scenarios:
- Serverless (e.g. Azure Functions)
- Containers (e.g. Kubernetes)
In general, AoT brings in the following benefits:
- Reduced app size
- This is important for cloud scenarios where its desirable to achieve higher container density.
- Faster startup:
- This impacts cold starts of the application, which is important in serverless contexts.
- Scale out of rolling updates in Cloud scenarios.
- Reduced memory demand:
- AoT apps generally run with less memory compared to JIT apps, since there are many runtime components that are not needed.
- Increased performance:
- Many of the constraints imposed by AoT are addressed via optimizations that can be applied at compile time, which in many cases
leads to better performance.
- Many of the constraints imposed by AoT are addressed via optimizations that can be applied at compile time, which in many cases
- Enhanced security:
- AoT apps are less susceptible to runtime attacks, since the code is already compiled and there is no JITing happening at runtime.
- When running in container scenarios, you can "chisel" the container to only have the minimum code needed for the app to run, reducing the surface attack area.
Goals/Scope of the work
- Investigate and list all the blockers that prevent the app from being AoT.
- Understand the available solutions for each problem (source generation, etc.)
- Identify the fixes that we think are valuable for other reasons (perf, better trimming, etc.)
- Prioritize the set of changes we want to tackle in .NET 9.0 to drive towards this scenario (low hanging fruit, performance, trimming)
Reasoning
We only get the benefits of AoT if we remove all the blockers, so we want to reduce the cost as much as possible by making changes that provide immediate value for other reasons (perf, trimming, etc).
Reacted by David Rettenbacher, LukasKubicek, Sven Boemer, PodyNoo, Mads Konradsen, Marcus Lorentzon, Matthew King, arthastheking113, Ali Aslan, MoGu and 31 more
Reacted by arthastheking113, Ali Aslan, Caio Henrique Figurski, Eugene Bekker and Johan Benschop
Reacted by arthastheking113, Ali Aslan, Eric Erhardt, Echostorm, Godwin Peter .O, Marcel van der Gragt, Eugene Bekker and Johan Benschop
Reacted by arthastheking113, Ali Aslan, Eric Erhardt, Caio Henrique Figurski, Echostorm, Eugene Bekker and Johan Benschop
Reacted by arthastheking113, Ali Aslan, Caio Henrique Figurski, Echostorm, Eugene Bekker and Johan Benschop
Sub-issues
Collapse Sub-issuesSub-issues
Loading 2 sub-issues
Metadata
Metadata
Assignees
Labels
NativeAOTPillar: Technical DebtPriority:1Work that is critical for the release, but we could probably ship withoutarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onetriaged
Activity
javiercn commentedon Oct 24, 2023
/cc @danroth27
javiercn commentedon Oct 24, 2023
#40033
danroth27 commentedon Oct 24, 2023
Related issue tracking enabling full trimming: #49409
[-][Blazor] Enable Blazor apps running inside of ASP.NET Core to be trimmed and AoT compiled[/-]15 remaining items
kimdiego2098 commentedon Jun 12, 2025
hi,any new?
danroth27 commentedon Jun 12, 2025
@kimdiego2098 Nothing planned for .NET 10.
alexyakunin commentedon Apr 2, 2026
Any news?
danroth27 commentedon Apr 3, 2026
@alexyakunin We hope to make some progress on this in the .NET 11 timeframe, but it's not a committed feature on our .NET 11 roadmap.
maloo commentedon Apr 3, 2026
@danroth27 Would it be an option to first add support for trimming? I've lost many project to other languages where the stand alone exe file size is a limitation. Like CLIs that need a UI och Linux services with admin UIs. Often over 100MB for a basic Blazor app. Considering minimal api and Blazor wasm supports trimming I hope it is not that much left to make it trimmable? Maybe even if some features would be unavailable (unless core ofc). Do you know what is blocking trimming? SignalR?
danroth27 commentedon Apr 3, 2026
@maloo Yes, that's the bulk of the work. See the child issues of this parent issue.
fix(aot): correct ILC gating in the AOT smoke app
fix(aot): correct ILC gating in the AOT smoke app
fix(aot): keep ComponentBase-derived construction out of the AOT smok…