Description
Description
The dotnet package list
command now performs a restore before listing packages to ensure accurate and up-to-date results. This is a behavioral change from the previous implementation where the command did not require a restore step.
Additionally, if the restore operation fails, an error message is logged. The error is displayed in both plain text and JSON formats based on the command usage.
Version
.NET 10 Preview 4
Previous behavior
The dotnet package list
command listed project packages without performing a restore. If a restore was needed, users had to perform it manually before running the command.
New behavior
The dotnet package list
command now automatically performs a restore operation before listing packages, ensuring the output reflects the latest state of the project dependencies. If the restore fails, the command will not proceed to list packages and will log an error message as described above.
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
This change was introduced to ensure the dotnet package list
command provides accurate and up-to-date package information.
Recommended action
If this change causes issues in your workflow:
- Users who want to bypass the implicit restore can use the
--no-restore
option with thedotnet package list
command. This allows them to opt out of the restore step if it is not required for their workflow. - Ensure your project is ready for restore before running the
dotnet package list
command. - Alternatively, you can manually run
dotnet restore
before invoking the command to decouple the restore step.
Feature area
SDK
Affected APIs
N/A
Metadata
Metadata
Assignees
Type
Projects
Status