SHFB icon indicating copy to clipboard operation
SHFB copied to clipboard

`dotnet list package` breaks on solution when it contains a SHFB project

Open Zastai opened this issue 6 months ago • 1 comments

Thought I had reported this already but, apparently not.

The current .NET SDK contains commands to list packages used by a project (or all projects in a solution), including showing which ones have vulnerabilities and/or are outdated.

The basic one is dotnet list package.

However, when this is run on a solution that includes a SHFB project, it fails:

PS C:\xxx> dotnet list package
error: The imported project "C:\xxx\apidoc\SandcastleHelpFileBuilder.targets" was not found. Confirm that the expression in the Import declaration "SandcastleHelpFileBuilder.targets" is correct, and that the file exists on disk.  C:\xxx\apidoc\Foo.shfbproj


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].

So it looks like the juggling that avoids requiring SHFBROOT to be set at restore time will need to also detect this context.

This blocks the functionality for the entire solution (running them on projects separately does still work).

Zastai avatar Aug 23 '24 10:08 Zastai