Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The dotnet package list command now automatically performs a restore operation 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.
Version introduced
.NET 10
Previous behavior
The dotnet package list command listed project packages without performing a restore. If a restore was needed, you had to run it manually before using the command.
New behavior
The dotnet package list command now automatically performs a restore before listing packages. If the restore fails, the command doesn't list packages and instead logs an error message in both plain text and JSON formats, depending on the command usage.
Type of breaking change
This change is a behavioral change.
Reason for change
This change ensures the dotnet package list command provides accurate and up-to-date package information.
Recommended action
If this change causes issues in your workflow:
- Use the
--no-restoreoption withdotnet package listif you want to bypass the implicit restore step. - Make sure your project is ready for restore before running the
dotnet package listcommand. - Alternatively, run
dotnet restoremanually before usingdotnet package listto decouple the restore step.
Affected APIs
None.