My Digital Garden

Dotnet local tool

Install and use .NET local tools

Summary

This looks like it would be most useful when a tool is relevant in the context of a specific project. Otherwise would install as DotNet global tool.

Source Link

Note captured: 08/07/2022

Bookmark created: 08/07/2022

See also

Highlights from source page

This tutorial teaches you how to install and use a local tool

To install a tool for local access only (for the current directory and subdirectories), it has to be added to a manifest file.

Create a manifest file

dotnet new tool-manifest

The tools listed in a manifest file are available to the current directory and subdirectories. The current directory is the one that contains the .config directory with the manifest file.

Install local tool

dotnet tool install --add-source <relative path to nupkg folder> <toolname>

Run local tool

dotnet tool run <toolname>

Restore a local tool installed by others

You typically install a local tool in the root directory of the repository. After you check in the manifest file to the repository, other developers can get the latest manifest file. To install all of the tools listed in the manifest file, they can run a single dotnet tool restore command.

Update a local tool

dotnet tool update <tool name>

Remove local tools

dotnet tool uninstall <tool name>