Skip to content

[Breaking change]: dotnet nuget why changed output formatting #53525

@zivkan

Description

@zivkan

Description

The NuGet team had a request for dotnet nuget why to output both requested and resolved versions, whereas the command was previously outputting only the resolved version.

This can break scripts that automatically parse the command output and expect the previous format

This change will take effect in the .NET 10.0.400 SDK

Version

.NET 10

Previous behavior

As can be seen in the original feature request:

dotnet nuget why previously would output a package information similar to System.Text.Json (v9.0.0-rc.2.24427.10)

New behavior

As can be seen in the pull request implementing the change: NuGet/NuGet.Client#7344

the format is now changing to System.Text.Json@10.0.1 (>= 9.0.0)

Type of breaking change

  • Binary incompatible: Existing binaries might encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code might require source changes to compile successfully.
  • Behavioral change: Existing binaries might behave differently at run time.

Reason for change

When investigating why a transitive package is using the resolved version, it's helpful to understand what each of the requested versions are from the packages that list it as a dependency.

Recommended action

If you use a regex or similar to parse the output of dotnet nuget why, update it to handle the new output format. If some team members or CI agents are running older versions of the .NET SDK, the regex or parsing should support both formats.

Feature area

SDK

Affected APIs

No response


Associated WorkItem - 574431

Metadata

Metadata

Labels

📌 seQUESTeredIdentifies that an issue has been imported into Quest.breaking-changeIndicates a .NET Core breaking change

Type

No type
No fields configured for issues without a type.

Projects

Status

👀 In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions