Skip to content

Document DOTNET_CLI_ENABLEAOT environment variable#54649

Open
baronfel wants to merge 5 commits into
mainfrom
enable-naot-cli-envvar-docs
Open

Document DOTNET_CLI_ENABLEAOT environment variable#54649
baronfel wants to merge 5 commits into
mainfrom
enable-naot-cli-envvar-docs

Conversation

@baronfel

@baronfel baronfel commented Jul 6, 2026

Copy link
Copy Markdown
Member

Documents the DOTNET_CLI_ENABLEAOT environment variable in the .NET SDK and CLI environment variables reference.

Starting with the .NET SDK preview that resolves dotnet/sdk#55078, the SDK''s NativeAOT-compiled CLI command-handling fast path is enabled by default. This adds a reference entry describing its purpose, the enabled-by-default behavior, and the accepted opt-out values (false/0/no/off).

Fixes #54648


Internal previews

📄 File 🔗 Preview link
docs/core/tools/dotnet-environment-variables.md docs/core/tools/dotnet-environment-variables

Adds the DOTNET_CLI_ENABLEAOT variable (NativeAOT CLI command-handling fast path, enabled by default) to the .NET SDK and CLI environment variables reference.

Fixes #54648
Copilot AI review requested due to automatic review settings July 6, 2026 14:30
@baronfel baronfel requested review from a team and meaghanlewis as code owners July 6, 2026 14:30
@dotnetrepoman dotnetrepoman Bot added this to the July 2026 milestone Jul 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 documents the DOTNET_CLI_ENABLEAOT environment variable in the .NET SDK/CLI environment variables reference, describing how it controls the NativeAOT-based CLI fast path and its default behavior.

Changes:

  • Adds DOTNET_CLI_ENABLEAOT to the .NET SDK and CLI environment variables list.
  • Introduces a new section that explains the variable’s purpose, default enabled state, and accepted enable/disable values.

Comment on lines +330 to +332
Specifies whether the .NET SDK uses its native (ahead-of-time compiled) CLI command-handling fast path. When enabled, common commands (such as command parsing, `dotnet --version`, and `dotnet --info`) are handled by a native entry point for faster startup, transparently falling back to the managed CLI for anything the fast path doesn't handle.

This fast path is enabled by default. To opt out and route every invocation to the managed CLI, set this variable to `false`, `0`, `no`, or `off`. To explicitly enable it, set it to `true`, `1`, `yes`, or `on`, or leave it unset.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 3fcddf8: the default is now stated separately in a Note, enable/disable values are listed symmetrically as their own bullets, and command parsing is now command-line parsing.

@BillWagner BillWagner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM @baronfel

I had one question for you to decide on, and then this is ready to merge.

Comment thread docs/core/tools/dotnet-environment-variables.md Outdated
@baronfel baronfel requested a review from BillWagner July 6, 2026 21:27
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.

Document DOTNET_CLI_ENABLEAOT environment variable (NativeAOT CLI fast path, enabled by default) Enable NAOT command handling by default

3 participants