Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/core/compatibility/10.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
Original file line number Diff line number Diff line change
@@ -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 `<PackageName> (v<ResolvedVersion>)`.

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 `<PackageName>@<ResolvedVersion> (>= <RequestedVersion>)`.

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 `<PackageName>@<ResolvedVersion> (>= <RequestedVersion>)`.

If your colleagues or CI agents run older versions of the .NET SDK, update the parsing logic to support both formats:

- Old format: `<PackageName> (v<ResolvedVersion>)`
- New format: `<PackageName>@<ResolvedVersion> (>= <RequestedVersion>)`

## Affected APIs

None.
2 changes: 2 additions & 0 deletions docs/core/compatibility/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/core/tools/dotnet-nuget-why.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, the command changed its output format for packages. Each package now displays the resolved version and the minimum requested version constraint: `<PackageName>@<ResolvedVersion> (>= <RequestedVersion>)`. 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):
Expand Down
Loading