dotnet / dotnet/sdk

Enable the dotnet CLI to be shipped as a Native AOT application

Open
#49,667 4 comments 24 reactions 2 assignees Claimed by @JeremyKuhne View on GitHub
Area-CLI Area-dotnet AOT Area-NativeAOT
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

# Enable .NET SDK Native-AOT Compilation

## Summary

Transform the .NET SDK into a Native-AOT compiled application to significantly reduce startup time and improve performance for every single use of the `dotnet` CLI.

## Motivation

The .NET CLI is one of the most frequently used developer tools in the .NET ecosystem. Currently, each CLI invocation incurs approximately **~150ms of startup overhead** due to the managed runtime initialization process. While this may seem insignificant for individual commands, the aggregate impact is substantial:

- **Developer productivity**: The cumulative delay across daily workflows significantly impacts developer experience
- **Global scale impact**: With billions of monthly invocations, even small improvements translate to massive time savings
- **Resource efficiency**: Reduced memory footprint and faster startup times benefit both local development and cloud-based build environments

By converting the .NET SDK to Native-AOT, we can eliminate most of this startup overhead, providing near-instantaneous command execution and dramatically improving the developer experience at scale. We can also showcase and encourage the adoption of Native AOT for CLI applications, and make the `dotnet` CLI an example of a best-in-class .NET CLI application all-up.

## Scope and Approach

This Epic encompasses the technical work required to enable Native-AOT compilation of the .NET SDK, including infrastructure changes, library updates, and runtime integration modifications. The work will be executed in phases, starting with AOT compatibility enablement and culminating in a hybrid architecture where AOT handles command parsing while managed code handles complex operations.

We're doing this in tiers:

* [x] we produce a NAOT binary entrypoint
* [x] muxer calls this entrypoint
* [x] NAOT entrypoint handles command parsing and telemetry with managed-fallback for unsupported commands
* [x] NAOT entrypoint has parity with managed entrypoint for UX, first-run, etc
* [ ] individual commands are made handle-able in the NAOT side

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.