You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of this writing, given a developer published a dotnet tool that uses, for example, a command name "hello" (i.e. <ToolCommandName>hello</ToolCommandName>), the way to execute the tool is different depending on how the user installed the tool
If the user installed as a global tool, they can only run it using hello
If the user installed as a local tool, they can only run it using either dotnet hello or dotnet tool run hello
This makes it difficult for build scripts/systems to execute dotnet tools where they cannot control how the user installed it.
i.e. If a build script runs dotnet hello or dotnet tool run hello it should Just Work™ without the build script having any knowledge if the tool was installed globally or locally.
Request
When running dotnet <toolname> or dotnet tool run <toolname> try to run a local tool first, and fallback to a global tool with the same name.
If a tool has a command of `csharpier` then to invoke it as a local tool
you need to use `dotnet csharpier`. Only a globally installed tool works
with `csharpier`. It doesn't seem worth the trouble to change the
command because of that.
If dotnet/sdk#14626 is done, this can be
revisited.
closes#1450
As of this writing, given a developer published a dotnet tool that uses, for example, a command name "hello" (i.e.
<ToolCommandName>hello</ToolCommandName>
), the way to execute the tool is different depending on how the user installed the toolhello
dotnet hello
ordotnet tool run hello
This makes it difficult for build scripts/systems to execute dotnet tools where they cannot control how the user installed it.
i.e. If a build script runs
dotnet hello
ordotnet tool run hello
it should Just Work™ without the build script having any knowledge if the tool was installed globally or locally.Request
When running
dotnet <toolname>
ordotnet tool run <toolname>
try to run a local tool first, and fallback to a global tool with the same name.If multiple tools with the same name are resolved, pick the one that is closer.
Repro steps
Install a dotnet tool that does not have the
dotnet-
prefix as a local tool:✅ Both ways of executing the tool work
❌ Executing the tool directly does not work
Install a dotnet tool that does not have the
dotnet-
prefix as a global tool:❌ Both commands fail and the tool is not found
✅ Executing the tool directly works
The text was updated successfully, but these errors were encountered: