Skip to content

Document .NET 11 apphost invocation-name behavior - #56390

Merged
BillWagner merged 4 commits into
mainfrom
copilot/breaking-change-environment-getcommandlineargs
Oct 14, 2026
Merged

BillWagner merged 4 commits into
mainfrom
copilot/breaking-change-environment-getcommandlineargs

Conversation

Copilot AI commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Starting in .NET 11 Preview 7, Environment.GetCommandLineArgs()[0] preserves the name used to invoke an apphost, including relative paths and symlink names. Launching an app with dotnet <application.dll> retains its existing behavior.

  • Breaking-change article: Document the previous and new behavior, affected API, and migration guidance. Use Environment.ProcessPath for the executable path and Assembly.GetEntryAssembly()?.Location for the managed assembly location.
  • Navigation and related guidance: Add the article to the .NET 11 compatibility TOC and index, and update the single-file compatibility and deployment docs.

For example, launching ./special_myapp through a symlink now makes Environment.GetCommandLineArgs()[0] return ./special_myapp.


Internal previews

File Preview link
docs/core/compatibility/11.md Learn preview
docs/core/compatibility/core-libraries/11/environment-getcommandlineargs-apphost-invocation-name.md Learn preview
docs/core/compatibility/core-libraries/5.0/assembly-api-behavior-changes-for-single-file-publish.md Learn preview
docs/core/compatibility/toc.yml Learn preview
docs/core/deploying/single-file/overview.md Learn preview

Build report

Copilot AI balanced review requested due to automatic review settings October 13, 2026 18:59

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.

Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.

Copilot AI changed the title [WIP] Fix Environment.GetCommandLineArgs()[0] invocation name preservation Document .NET 11 apphost invocation-name behavior Oct 13, 2026
Copilot AI requested a review from BillWagner October 13, 2026 19:06

@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.

I have one issue to address before this is ready.

Co-authored-by: BillWagner <[email protected]>

@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. Let's :shipit:

@BillWagner
BillWagner marked this pull request as ready for review October 13, 2026 20:13
@BillWagner
BillWagner requested review from a team, adegeo and gewarren as code owners October 13, 2026 20:13
…ndlineargs-apphost-invocation-name.md

Co-authored-by: Genevieve Warren <[email protected]>
@BillWagner
BillWagner merged commit 56750bb into main Oct 14, 2026
13 checks passed
@BillWagner
BillWagner deleted the copilot/breaking-change-environment-getcommandlineargs branch October 14, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Breaking change]: Environment.GetCommandLineArgs()[0] preserves the executable invocation name

4 participants