Skip to content

library "not found in package" hint recommends --path "lib/", which lists nothing #9916

Open

Description

@richlander

Problem

When library <L> --package P can't find <L>, it prints:

Error: Library 'Nope' not found in package.
Use 'dotnet-inspect package <name> --path "lib/"' to list available libraries.

--path "lib/" is a directory selector. A trailing slash selects only the immediate files in that directory (PackageFileLister.cs:120-125). That is by design, but lib/ normally holds only framework subdirectories, so the suggested command lists nothing:

$ dotnet-inspect package EntityFramework@6.4.4 --path lib/
Note: 1 matched section has no data: Files.
# EntityFramework

The hint appears in two places, LibraryCommand.cs:5245 (the --tfm all branch) and LibraryCommand.cs:5260 (the named-Library search).

Fix

Point the hint at a command that lists the package's library assets, for example:

$ dotnet-inspect package EntityFramework@6.4.4 -S Files --lib
EntityFramework 6.4.4 (NuGet)
└─ lib
   ├─ net40
   │  ├─ EntityFramework.SqlServer.dll
   ...

The --tfm all branch at line 5245 retires under #9915/#9833, because library ... --tfm all will fail before acquisition. Only the hint at line 5260 then needs fixing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions