Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 6, 2025

Description

This PR documents the breaking change introduced in .NET 10 RC 2 where dotnet CLI commands now emit non-command-relevant data (such as first-run messages) to stderr instead of stdout. This change addresses the requirement to keep stdout clean for parsing and interpretation in scripting and noninteractive scenarios.

Changes

New Documentation

  • docs/core/compatibility/sdk/10.0/dotnet-cli-stderr-output.md: Comprehensive breaking change document that includes:
    • Clear explanation of the behavior change (first-run messages now emit to stderr)
    • Code examples showing the difference between previous and new behavior
    • Rationale for the change (enables better scriptability)
    • Recommended actions for users, including:
      • PowerShell 7.2+ guidance (where stderr doesn't set $Error)
      • How to use DOTNET_NOLOGO to disable messages
      • Examples of redirecting stderr separately

Updated Documentation

  • docs/core/compatibility/10.0.md: Added entry to SDK and MSBuild section table
  • docs/core/compatibility/toc.yml: Added TOC entry for navigation
  • docs/core/tools/telemetry.md: Added NOTE in the Disclosure section explaining the stderr behavior change with cross-reference to the breaking change document

Context

Starting with .NET 10 RC 2 (SDK PR #50472), the .NET CLI has been improved to separate command output from informational messages. Currently, this affects first-run messages, but the set of messages emitted to stderr will grow over time as the SDK evolves.

This change improves the developer experience by:

  • Allowing clean stdout for piping and parsing in scripts
  • Enabling better integration with CI/CD pipelines
  • Reducing confusion about what is "core" command output vs informational messages

Fixes https://dev.azure.com/msft-skilling/Content/_workitems/edit/494515

Original prompt

This section details on the original issue you should resolve

<issue_title>[Breaking change]: some dotnet CLI commands will log verbose/non-command-relevant data to stderr instead of stdout</issue_title>
<issue_description>### Description

Starting in .NET 10.0.100 RC2 with dotnet/sdk#50472, some dotnet CLI command output that is not 'core' to the command being invoked will be emitted to stderr instead of stdout. At time of this writing, the only change is the first-run message output, but this set will grow over time.

Version

.NET 10 RC 2

Previous behavior

First-run messages for the dotnet CLI emit to stdout

New behavior

First-run messages for the dotnet CLI emit to stderr

Type of breaking change

  • Binary incompatible: Existing binaries might encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code might require source changes to compile successfully.
  • Behavioral change: Existing binaries might behave differently at run time.

Reason for change

Writing information to stdout that isn't directly related to the command being invoked inhibits the use of commands in scripting or noninteractive circumstances. Moving to stderr emission for non-primary outputs like diagnostics, verbose messages, or incidental notifications means that stdout remains clean for parsing or other interpretation.

Recommended action

For most non-PowerShell users, this change shouldn't be a huge change. For PowerShell users, we recommend:

  • using at least PowerShell version 7.2, where redirecting to stderr doesn't set PowerShell's $Error variable and cause Powershell to think the previous command failed execution

Feature area

SDK

Affected APIs

No response


Associated WorkItem - 494515</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #48081

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] [Breaking change]: some dotnet CLI commands will log verbose/non-command-relevant data to stderr instead of stdout Document breaking change: dotnet CLI commands log non-command-relevant data to stderr Oct 6, 2025
@Copilot Copilot AI requested a review from gewarren October 6, 2025 19:27
Copilot finished work on behalf of gewarren October 6, 2025 19:27
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]: some dotnet CLI commands will log verbose/non-command-relevant data to stderr instead of stdout
2 participants