Skip to content

Commit 9a4b0fe

Browse files
authored
Document breaking change: dotnet CLI commands log non-command-relevant data to stderr (#48924)
1 parent 88ba524 commit 9a4b0fe

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

docs/core/compatibility/10.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af
105105
| Title | Type of change | Introduced version |
106106
|-------|-------------------|--------------------|
107107
| [.NET CLI `--interactive` defaults to `true` in user scenarios](sdk/10.0/dotnet-cli-interactive.md) | Behavioral change | Preview 3 |
108+
| [`dotnet` CLI commands log non-command-relevant data to stderr](sdk/10.0/dotnet-cli-stderr-output.md) | Behavioral change | RC 2 |
108109
| [.NET tool packaging creates RuntimeIdentifier-specific tool packages](sdk/10.0/dotnet-tool-pack-publish.md) | Behavioral change | Preview 6 |
109110
| [Default workload configuration from 'loose manifests' to 'workload sets' mode](sdk/10.0/default-workload-config.md) | Behavioral change | Preview 2 |
110111
| [`dotnet new sln` defaults to SLNX file format](sdk/10.0/dotnet-new-sln-slnx-default.md) | Behavioral change | RC 1 |
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: "Breaking change - dotnet CLI commands log non-command-relevant data to stderr"
3+
description: "Learn about the breaking change in .NET 10 where some dotnet CLI commands log verbose and non-command-relevant data to stderr instead of stdout."
4+
ms.date: 10/08/2025
5+
ai-usage: ai-generated
6+
ms.custom: https://dev.azure.com/msft-skilling/Content/_workitems/edit/494515
7+
---
8+
9+
# dotnet CLI commands log non-command-relevant data to stderr
10+
11+
Starting in .NET 10, some `dotnet` CLI command output that isn't core to the command being invoked emits to `stderr` instead of `stdout`.
12+
13+
## Version introduced
14+
15+
.NET 10 RC 2
16+
17+
## Previous behavior
18+
19+
Previously, first-run messages for the `dotnet` CLI emitted to `stdout`.
20+
21+
## New behavior
22+
23+
Starting in .NET 10, first-run messages for the `dotnet` CLI emit to `stderr`. (In the future, more messages will undergo a similar change.)
24+
25+
## Type of breaking change
26+
27+
This change is a [behavioral change](../../categories.md#behavioral-change).
28+
29+
## Reason for change
30+
31+
Information that's written to `stdout` that isn't directly related to the command being invoked inhibits the use of commands in scripting or noninteractive circumstances. When non-primary outputs like diagnostics, verbose messages, and incidental notifications are moved to `stderr`, `stdout` remains clean for parsing or other interpretation.
32+
33+
## Recommended action
34+
35+
For most non-PowerShell users, this change shouldn't require any action.
36+
37+
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.
38+
39+
## Affected APIs
40+
41+
None.

docs/core/compatibility/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ items:
114114
items:
115115
- name: .NET CLI `--interactive` defaults to `true` in user scenarios
116116
href: sdk/10.0/dotnet-cli-interactive.md
117+
- name: "`dotnet` CLI commands log non-command-relevant data to stderr"
118+
href: sdk/10.0/dotnet-cli-stderr-output.md
117119
- name: .NET tool packaging creates RuntimeIdentifier-specific tool packages
118120
href: sdk/10.0/dotnet-tool-pack-publish.md
119121
- name: "`dotnet restore` audits transitive packages"

docs/core/tools/telemetry.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ A single telemetry entry is also sent by the .NET SDK installer when a successfu
3333
3434
## Disclosure
3535

36-
The .NET SDK displays text similar to the following when you first run one of the [.NET CLI commands](index.md) (for example, `dotnet build`). Text may vary slightly depending on the version of the SDK you're running. This "first run" experience is how Microsoft notifies you about data collection.
36+
The .NET SDK displays text similar to the following when you first run one of the [.NET CLI commands](index.md) (for example, `dotnet build`). Text might vary slightly depending on the version of the SDK you're running. This "first run" experience is how Microsoft notifies you about data collection.
37+
38+
> [!NOTE]
39+
> **Breaking change:** The behavior of telemetry messages written to `stderr` has changed in recent versions of the .NET SDK. For more information, see the [breaking change documentation](/dotnet/core/compatibility/sdk/8.0/telemetry-stderr-behavior).
3740
3841
```console
3942
Telemetry

0 commit comments

Comments
 (0)