From 7bc46639a3e9820d4bcf68bc2e5e57a23eacbcda Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 17:59:58 +0000 Subject: [PATCH 1/3] Initial plan From 3655c8b3cdabeb059bf1a56c0b045c991398f1db Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 18:02:56 +0000 Subject: [PATCH 2/3] Add breaking change article for dotnet nuget why output format change Agent-Logs-Url: https://github.com/dotnet/docs/sessions/4256e46b-9525-4aca-8217-dc244fe0a039 Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --- docs/core/compatibility/10.md | 1 + .../10.0/dotnet-nuget-why-output-format.md | 55 +++++++++++++++++++ docs/core/compatibility/toc.yml | 2 + docs/core/tools/dotnet-nuget-why.md | 2 + 4 files changed, 60 insertions(+) create mode 100644 docs/core/compatibility/sdk/10.0/dotnet-nuget-why-output-format.md diff --git a/docs/core/compatibility/10.md b/docs/core/compatibility/10.md index e3705fdec883e..fef44fd743e73 100644 --- a/docs/core/compatibility/10.md +++ b/docs/core/compatibility/10.md @@ -125,6 +125,7 @@ See [Breaking changes in EF Core 10](/ef/core/what-is-new/ef-core-10.0/breaking- | [Double quotes in file-level directives are disallowed](sdk/10.0/file-level-directive-double-quotes.md) | Source incompatible | | [`dotnet new sln` defaults to SLNX file format](sdk/10.0/dotnet-new-sln-slnx-default.md) | Behavioral change | | [`dotnet package list` performs restore](sdk/10.0/dotnet-package-list-restore.md) | Behavioral change | +| [`dotnet nuget why` output format changed](sdk/10.0/dotnet-nuget-why-output-format.md) | Behavioral change | | [`dotnet restore` audits transitive packages](sdk/10.0/nugetaudit-transitive-packages.md) | Behavioral change | | [`dotnet tool install --local` creates manifest by default](sdk/10.0/dotnet-tool-install-local-manifest.md) | Behavioral change | | [`dotnet watch` logs to stderr instead of stdout](sdk/10.0/dotnet-watch-stderr.md) | Behavioral change | diff --git a/docs/core/compatibility/sdk/10.0/dotnet-nuget-why-output-format.md b/docs/core/compatibility/sdk/10.0/dotnet-nuget-why-output-format.md new file mode 100644 index 0000000000000..2c547597de3fc --- /dev/null +++ b/docs/core/compatibility/sdk/10.0/dotnet-nuget-why-output-format.md @@ -0,0 +1,55 @@ +--- +title: "Breaking change: `dotnet nuget why` output format changed" +description: "Learn about the breaking change in .NET 10.0.400 SDK where `dotnet nuget why` changed its output format to show both requested and resolved package versions." +ms.date: 05/05/2026 +ai-usage: ai-assisted +--- + +# `dotnet nuget why` output format changed + +The [`dotnet nuget why`](../../../tools/dotnet-nuget-why.md) command changed its package version output format to include both the requested version constraint and the resolved version. + +## Version introduced + +.NET 10.0.400 SDK + +## Previous behavior + +Previously, `dotnet nuget why` displayed each package in the dependency graph using only the resolved version, in the format ` (v)`. + +For example: + +```output +System.Text.Json (v9.0.0-rc.2.24427.10) +``` + +## New behavior + +Starting in .NET 10.0.400 SDK, `dotnet nuget why` displays each package using the resolved version and the minimum requested version constraint, in the format `@ (>= )`. + +For example: + +```output +System.Text.Json@10.0.1 (>= 9.0.0) +``` + +## Type of breaking change + +This change is a [behavioral change](../../categories.md#behavioral-change). + +## Reason for change + +To help you investigate why a transitive package resolves to a particular version, the output now shows both the version that each dependent package requested and the version that NuGet actually resolved. This information makes it easier to understand version conflicts and dependency requirements. + +## Recommended action + +If you use a regular expression or other string parsing to process the output of `dotnet nuget why`, update your parsing logic to handle the new format `@ (>= )`. + +If some team members or CI agents might run older versions of the .NET SDK, update the parsing logic to support both formats: + +- Old format: ` (v)` +- New format: `@ (>= )` + +## Affected APIs + +None. diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index 327c0135cd2f8..33991bfeb16ff 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -202,6 +202,8 @@ items: href: sdk/10.0/dotnet-package-list-restore.md - name: "`dotnet tool install --local` creates manifest by default" href: sdk/10.0/dotnet-tool-install-local-manifest.md + - name: "`dotnet nuget why` output format changed" + href: sdk/10.0/dotnet-nuget-why-output-format.md - name: "`dotnet watch` logs to stderr instead of stdout" href: sdk/10.0/dotnet-watch-stderr.md - name: HTTP warnings promoted to errors in package list and search diff --git a/docs/core/tools/dotnet-nuget-why.md b/docs/core/tools/dotnet-nuget-why.md index c2c1a5797b3cf..e33360ce6ee77 100644 --- a/docs/core/tools/dotnet-nuget-why.md +++ b/docs/core/tools/dotnet-nuget-why.md @@ -27,6 +27,8 @@ The `dotnet nuget why` command shows the dependency graph for a particular packa Starting with version 9.0.200, the command introduces support for runtime identifier (RID) specific packages by generating separate dependency trees for each RID and framework combination. For example, if a project targets `net9.0` with the `win-x64` RID, the command generates trees for `net9.0/win-x64` and `net9.0`. +Starting with version 10.0.400 SDK, the command changed its output format for packages. Each package now displays the resolved version and the minimum requested version constraint: `@ (>= )`. For more information, see [`dotnet nuget why` output format changed](../compatibility/sdk/10.0/dotnet-nuget-why-output-format.md). + ### Older project format To use the command with projects that can't be restored with the .NET SDK, you can pass a NuGet assets file in place of the project file (starting with the .NET 9 SDK): From cedc167bba165a9fef1cfce17784035c3800e5d8 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 5 May 2026 11:32:12 -0700 Subject: [PATCH 3/3] Apply suggestions from code review --- .../compatibility/sdk/10.0/dotnet-nuget-why-output-format.md | 2 +- docs/core/tools/dotnet-nuget-why.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/core/compatibility/sdk/10.0/dotnet-nuget-why-output-format.md b/docs/core/compatibility/sdk/10.0/dotnet-nuget-why-output-format.md index 2c547597de3fc..ecfc8fa034dbb 100644 --- a/docs/core/compatibility/sdk/10.0/dotnet-nuget-why-output-format.md +++ b/docs/core/compatibility/sdk/10.0/dotnet-nuget-why-output-format.md @@ -45,7 +45,7 @@ To help you investigate why a transitive package resolves to a particular versio If you use a regular expression or other string parsing to process the output of `dotnet nuget why`, update your parsing logic to handle the new format `@ (>= )`. -If some team members or CI agents might run older versions of the .NET SDK, update the parsing logic to support both formats: +If your colleagues or CI agents run older versions of the .NET SDK, update the parsing logic to support both formats: - Old format: ` (v)` - New format: `@ (>= )` diff --git a/docs/core/tools/dotnet-nuget-why.md b/docs/core/tools/dotnet-nuget-why.md index e33360ce6ee77..6874e7e111972 100644 --- a/docs/core/tools/dotnet-nuget-why.md +++ b/docs/core/tools/dotnet-nuget-why.md @@ -27,7 +27,7 @@ The `dotnet nuget why` command shows the dependency graph for a particular packa Starting with version 9.0.200, the command introduces support for runtime identifier (RID) specific packages by generating separate dependency trees for each RID and framework combination. For example, if a project targets `net9.0` with the `win-x64` RID, the command generates trees for `net9.0/win-x64` and `net9.0`. -Starting with version 10.0.400 SDK, the command changed its output format for packages. Each package now displays the resolved version and the minimum requested version constraint: `@ (>= )`. For more information, see [`dotnet nuget why` output format changed](../compatibility/sdk/10.0/dotnet-nuget-why-output-format.md). +Starting with version 10.0.400, the command changed its output format for packages. Each package now displays the resolved version and the minimum requested version constraint: `@ (>= )`. For more information, see [`dotnet nuget why` output format changed](../compatibility/sdk/10.0/dotnet-nuget-why-output-format.md). ### Older project format