Skip to content

Only get command line args names on modern .NET#13314

Merged
baronfel merged 1 commit intomainfrom
disable-argv-reading-on-framework
Mar 2, 2026
Merged

Only get command line args names on modern .NET#13314
baronfel merged 1 commit intomainfrom
disable-argv-reading-on-framework

Conversation

@baronfel
Copy link
Member

@baronfel baronfel commented Mar 2, 2026

Fixes a reported VS perf regression in assembly loads by just...not doing the feature from #13256 on framework builds of MSBuild.

Copilot AI review requested due to automatic review settings March 2, 2026 15:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Disables process command-line retrieval on .NET Framework builds to avoid a Visual Studio performance regression (extra assembly loads), while keeping the behavior available on modern .NET.

Changes:

  • On non-NET builds, ProcessExtensions.TryGetCommandLine now intentionally returns true with commandLine == null instead of performing WMI/COM command line retrieval.
  • Restricts TryGetCommandLine unit tests to modern .NET by switching them to [DotNetOnlyFact].

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Shared/ProcessExtensions.cs Avoids WMI/COM command line retrieval on .NET Framework builds by treating command line retrieval as “unsupported” (null command line).
src/Utilities.UnitTests/ProcessExtensions_Tests.cs Marks command line retrieval tests as .NET-only to align with disabled netfx behavior.

@baronfel baronfel enabled auto-merge (squash) March 2, 2026 16:03
@baronfel baronfel merged commit ac21192 into main Mar 2, 2026
14 checks passed
@baronfel baronfel deleted the disable-argv-reading-on-framework branch March 2, 2026 16:29
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.

3 participants