Skip to content
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

[Feature]: dotnet list [projet | solution] package does not work with solution filters #11789

Open
DOMZE opened this issue May 2, 2022 · 5 comments
Labels

Comments

@DOMZE
Copy link

DOMZE commented May 2, 2022

NuGet Product Used

dotnet.exe

Product Version

6.0.202

Worked before?

No response

Impact

It's more difficult to complete my work

Repro Steps & Context

dotnet restore works with solution filters.

dotnet list solution.slnf package --vulnerable fails with

error: Parameter "xml" cannot be null.

Usage: NuGet.CommandLine.XPlat.dll package list [arguments] [options]

Not sure if this is a bug or a feature that has not been implemented.

Verbose Logs

dotnet list solution.slnf package --vulnerable

The following sources were used:
   https://api.nuget.org/v3/index.json
   C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

error: Parameter "xml" cannot be null.


Usage: NuGet.CommandLine.XPlat.dll package list [arguments] [options]

Arguments:
  <PROJECT | SOLUTION>  A path to a project, solution file or directory.

Options:
  -h|--help               Show help information
  --force-english-output  Forces the application to run using an invariant, English-based culture.
  --framework             Specifies the target framework for which the packages will be listed.
  --deprecated            Displays only the packages marked deprecated by the authors.
  --outdated              Displays only the packages that need updates with the latest version from the sources.
  --vulnerable            Displays only the packages flagged as vulnerable.
  --include-transitive    Includes transitive packages too in the result.
  --include-prerelease    Considers prerelease versions when looking for latest. Works only with `--outdated`.
  --highest-patch         Considers only the versions with matching minor and major. Works only with `--outdated`.
  --highest-minor         Considers only the versions with matching major. Works only with `--outdated`.
  --source                Sources to lookup for latest versions. Works only with `--outdated`.
  --config                A path to a config file to specify sources. Works only with `--outdated`.
  --interactive           Allow the command to block and require manual action for operations like authentication.
  -v|--verbosity          Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
@martinrrm
Copy link
Contributor

My understanding is that Solution Filters only works with msbuild, not dotnet, when you do a dotnet restore it is going to restore the .sln. You can do a msbuild -r to restore the .slnf.

You can try using msbuild commands and see if you can do it. If you think this should be a feature you can open a feature request so the community can vote on it.

@martinrrm
Copy link
Contributor

Reopening, after talking with the team, they explained me that Solution Filter works with dotnet

@martinrrm martinrrm reopened this May 9, 2022
@zivkan zivkan changed the title [Bug]: dotnet list [projet | solution] package does not work with solution filters [Feature]: dotnet list [projet | solution] package does not work with solution filters May 12, 2022
@zivkan zivkan added Type:Feature Priority:2 Issues for the current backlog. and removed Type:Bug labels May 12, 2022
@dalibor-florian
Copy link

I have same problem while listing packages.
I'm using command dotnet list <csproj> package --outdated.
It worked on version 7.0.200 but today after upgrade to 7.0.201 i am getting same error as above.

error: Parameter "xml" cannot be null.


Usage: NuGet.CommandLine.XPlat.dll package list [arguments] [options]

Arguments:
  <PROJECT | SOLUTION>  A path to a project, solution file or directory.

Options:
  -h|--help               Show help information
  --force-english-output  Forces the application to run using an invariant, English-based culture.
  --framework             Specifies the target framework for which the packages will be listed.
  --deprecated            Displays only the packages marked deprecated by the authors.
  --outdated              Displays only the packages that need updates with the latest version from the sources.
  --vulnerable            Displays only the packages flagged as vulnerable.
  --include-transitive    Includes transitive packages too in the result.
  --include-prerelease    Considers prerelease versions when looking for latest. Works only with `--outdated`.
  --highest-patch         Considers only the versions with matching minor and major. Works only with `--outdated`.
  --highest-minor         Considers only the versions with matching major. Works only with `--outdated`.
  --source                Sources to lookup for latest versions. Works only with `--outdated`.
  --config                A path to a config file to specify sources. Works only with `--outdated`.
  --format                Set the report output format. 
  --output-version        The version of report output.
  --interactive           Allow the command to block and require manual action for operations like authentication.
  -v|--verbosity          Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].

@Sumit10612
Copy link

just wondering, is there any update on this?
is there any plan to make this work with solution filters? as the rest of the dotnet command does support .slnf.

@Psyk0loge
Copy link

Had a very similar issue where I just tried to run: "dotnet list package --vulnerable" in the command line and received this:
"error: Parameter "xml" cannot be null."

I later realized I had done a change in the code and it would not compile anymore...
When fixing the issue the command worked again...

the command seems to only work if you code complies...

Don't 100% know if it is related to the issue of op

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants