Skip to content

Differences between global tools invocations via generated apphost or dotnet CLI #47145

Open
@DamianEdwards

Description

@DamianEdwards

We maintain and ship a set of .NET CLI diagnostics tools documented at https://learn.microsoft.com/dotnet/core/diagnostics/tools-overview

Note that this documentation:

  • Refers to them all as "global tools" and only documents how to install them that way, i.e. no mention of using them as local tools
  • Documents the invocation command syntax as dotnet-toolname, i.e. directly invoking the tool apphost that's put on the path at tool install time

Global tools can be invoked either:

  • via the .NET CLI, e.g. dotnet tool-name; or
  • directly via the tool apphost shim that's on the path, e.g. dotnet-tool-name.

The different invocation patterns have implications on things like usage telemetry as the first pattern (via the .NET CLI) goes through the CLI's command and argument parsing pipeline, whereas the second pattern (via the apphost) does not. If the .NET CLI is not involved in the invocation of the tool, then no .NET CLI telemetry can be emitted.

Note: invocations of local tools always go through the .NET CLI, via the dotnet tool run command

We should consider how we might update the global tool invocation mechanism such that even if the tool is invoked directly via the executable on the path, the .NET CLI is involved such that things like usage telemetry can be facilitated (with all the usual considerations for opt-out, data privacy via hashing, etc.).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions