Skip to content

Commit 62ea86e

Browse files
Copilotgewarren
andcommitted
Add breaking change documentation for dotnet watch stderr logging
Co-authored-by: gewarren <[email protected]>
1 parent 4433bb9 commit 62ea86e

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

docs/core/compatibility/10.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af
111111
| [`dotnet package list` performs restore](sdk/10.0/dotnet-package-list-restore.md) | Behavioral change | Preview 4 |
112112
| [`dotnet restore` audits transitive packages](sdk/10.0/nugetaudit-transitive-packages.md) | Behavioral change | Preview 3 |
113113
| [`dotnet tool install --local` creates manifest by default](sdk/10.0/dotnet-tool-install-local-manifest.md) | Behavioral change | Preview 7 |
114+
| [`dotnet watch` logs internal-facing messages to stderr instead of stdout](sdk/10.0/dotnet-watch-stderr.md) | Behavioral change | RC 2 |
114115
| [project.json not supported in `dotnet restore`](sdk/10.0/dotnet-restore-project-json-unsupported.md) | Source incompatible | Preview 7 |
115116
| [SHA-1 fingerprint support deprecated in `dotnet nuget sign`](sdk/10.0/dotnet-nuget-sign-sha1-deprecated.md) | Behavioral change | Preview 1 |
116117
| [MSBUILDCUSTOMBUILDEVENTWARNING escape hatch removed](sdk/10.0/custom-build-event-warning.md) | Behavioral change | Preview 1 |
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: "Breaking change: 'dotnet watch' logs internal-facing messages to stderr instead of stdout"
3+
description: "Learn about the breaking change in .NET 10 RC 2 where 'dotnet watch' emits its log messages to stderr instead of stdout."
4+
ms.date: 01/16/2025
5+
ai-usage: ai-assisted
6+
ms.custom: https://github.com/dotnet/docs/issues/45871
7+
---
8+
# 'dotnet watch' logs internal-facing messages to stderr instead of stdout
9+
10+
Starting in .NET 10 RC 2, [`dotnet watch`](../../../tools/dotnet-watch.md) emits its own log messages to the `stderr` channel instead of `stdout`. This change is part of a general trend towards `dotnet` CLI commands not obscuring the `stdout` channel, which is often reserved for special semantics when running certain kinds of applications, like LSP or MCP servers.
11+
12+
## Version introduced
13+
14+
.NET 10 RC 2
15+
16+
## Previous behavior
17+
18+
Previously, [`dotnet watch`](../../../tools/dotnet-watch.md) emitted log messages to `stdout`.
19+
20+
## New behavior
21+
22+
Starting in .NET 10 RC 2, [`dotnet watch`](../../../tools/dotnet-watch.md) emits log messages to `stderr`.
23+
24+
## Type of breaking change
25+
26+
This change is a [behavioral change](../../categories.md#behavioral-change).
27+
28+
## Reason for change
29+
30+
This change is part of a general trend towards `dotnet` CLI commands not obscuring the `stdout` channel, which is often reserved or assumed to have special semantics when running certain kinds of applications, like LSP or MCP servers. This change was implemented in <https://github.com/dotnet/sdk/pull/50820>. In general, the CLI should get out of the way of your applications.
31+
32+
## Recommended action
33+
34+
Most users shouldn't need to take any action. If you need the `dotnet watch` messages on `stdout`, you can redirect the `stderr` stream to `stdout`. For example, use `2>&1` to redirect the `2` file descriptor for `stderr` to the `1` file descriptor for `stdout`:
35+
36+
```bash
37+
dotnet watch 2>&1
38+
```
39+
40+
## Affected APIs
41+
42+
None.

docs/core/compatibility/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ items:
128128
href: sdk/10.0/dotnet-package-list-restore.md
129129
- name: "`dotnet tool install --local` creates manifest by default"
130130
href: sdk/10.0/dotnet-tool-install-local-manifest.md
131+
- name: "`dotnet watch` logs internal-facing messages to stderr instead of stdout"
132+
href: sdk/10.0/dotnet-watch-stderr.md
131133
- name: MSBUILDCUSTOMBUILDEVENTWARNING escape hatch removed
132134
href: sdk/10.0/custom-build-event-warning.md
133135
- name: MSBuild custom culture resource handling

0 commit comments

Comments
 (0)