diff --git a/docs/core/compatibility/10.0.md b/docs/core/compatibility/10.0.md index 7d0c66625293f..d709fb69bad3f 100644 --- a/docs/core/compatibility/10.0.md +++ b/docs/core/compatibility/10.0.md @@ -105,6 +105,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af | Title | Type of change | Introduced version | |-------|-------------------|--------------------| | [.NET CLI `--interactive` defaults to `true` in user scenarios](sdk/10.0/dotnet-cli-interactive.md) | Behavioral change | Preview 3 | +| [`dotnet` CLI commands log non-command-relevant data to stderr](sdk/10.0/dotnet-cli-stderr-output.md) | Behavioral change | RC 2 | | [.NET tool packaging creates RuntimeIdentifier-specific tool packages](sdk/10.0/dotnet-tool-pack-publish.md) | Behavioral change | Preview 6 | | [Default workload configuration from 'loose manifests' to 'workload sets' mode](sdk/10.0/default-workload-config.md) | Behavioral change | Preview 2 | | [`dotnet new sln` defaults to SLNX file format](sdk/10.0/dotnet-new-sln-slnx-default.md) | Behavioral change | RC 1 | diff --git a/docs/core/compatibility/sdk/10.0/dotnet-cli-stderr-output.md b/docs/core/compatibility/sdk/10.0/dotnet-cli-stderr-output.md new file mode 100644 index 0000000000000..efbee406c5626 --- /dev/null +++ b/docs/core/compatibility/sdk/10.0/dotnet-cli-stderr-output.md @@ -0,0 +1,41 @@ +--- +title: "Breaking change - dotnet CLI commands log non-command-relevant data to stderr" +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." +ms.date: 10/08/2025 +ai-usage: ai-generated +ms.custom: https://dev.azure.com/msft-skilling/Content/_workitems/edit/494515 +--- + +# dotnet CLI commands log non-command-relevant data to stderr + +Starting in .NET 10, some `dotnet` CLI command output that isn't core to the command being invoked emits to `stderr` instead of `stdout`. + +## Version introduced + +.NET 10 RC 2 + +## Previous behavior + +Previously, first-run messages for the `dotnet` CLI emitted to `stdout`. + +## New behavior + +Starting in .NET 10, first-run messages for the `dotnet` CLI emit to `stderr`. (In the future, more messages will undergo a similar change.) + +## Type of breaking change + +This change is a [behavioral change](../../categories.md#behavioral-change). + +## Reason for change + +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. + +## Recommended action + +For most non-PowerShell users, this change shouldn't require any action. + +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. + +## Affected APIs + +None. diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index 18c08be85a233..e34d5f71d71d6 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -114,6 +114,8 @@ items: items: - name: .NET CLI `--interactive` defaults to `true` in user scenarios href: sdk/10.0/dotnet-cli-interactive.md + - name: "`dotnet` CLI commands log non-command-relevant data to stderr" + href: sdk/10.0/dotnet-cli-stderr-output.md - name: .NET tool packaging creates RuntimeIdentifier-specific tool packages href: sdk/10.0/dotnet-tool-pack-publish.md - name: "`dotnet restore` audits transitive packages" diff --git a/docs/core/tools/telemetry.md b/docs/core/tools/telemetry.md index 121c499658901..e3c4c9027d35c 100644 --- a/docs/core/tools/telemetry.md +++ b/docs/core/tools/telemetry.md @@ -33,7 +33,10 @@ A single telemetry entry is also sent by the .NET SDK installer when a successfu ## Disclosure -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. +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. + +> [!NOTE] +> **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). ```console Telemetry