-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet package list
command should restore first
#47873
base: main
Are you sure you want to change the base?
Conversation
src/Cli/dotnet/commands/Package/list/ListPackageReferencesCommand.cs
Outdated
Show resolved
Hide resolved
5ff051a
to
a8235d6
Compare
|
||
private int RunRestore(string projectOrSolution, ReportOutputFormat formatOption) | ||
{ | ||
MSBuildForwardingApp restoringCommand = new MSBuildForwardingApp(argsToForward: ["-target:restore", projectOrSolution, "-noConsoleLogger"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the implicit restore isn't logging anything, what if its takes more than a few seconds? I think the user might think something is wrong. We could pass console logger parameters to produce some output
-consoleLoggerParameters:Verbosity=Minimal;NoSummary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should try to align with test and run here and use the same logger configuration - ideally this would use terminal logger by default like every other command in the CLI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not so sure, the output of this command is the information about the packages that a project is referencing. Its not running tests (which are potentially long running) and its not building a project and its dependencies.
The only reason we need to run restore first is because the project.assets.json
file provides all of the information and we want to make sure its up-to-date. The only reason I propose we have any output at all about restore is in the case that it takes a while, I don't want users to think that dotnet list package
is hung.
#47400 had to many conflicts.
Fixes: NuGet/Home#13406
Description
This PR
dotnet package list
command ordotnet list package
(Switch verb and noun for package/reference add/remove/list Fixes #9650 #45384)ScreenShots
package list --project [project]
--format json

restore error

restore error: --format json
