Linux command
dotnet-tool 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Install global tool
dotnet tool install -g [tool-name]
List global tools
dotnet tool list -g
Update global tool
dotnet tool update -g [tool-name]
Uninstall global tool
dotnet tool uninstall -g [tool-name]
Install local tool
dotnet tool install [tool-name]
Restore local tools
dotnet tool restore
说明
dotnet tool manages .NET CLI tools, which are NuGet packages containing console applications. Tools can be installed globally (user-wide) or locally (project-specific). Global tools are available from any directory and installed in a user-specific location. Local tools are specified in a manifest file (dotnet-tools.json) and installed per-project. Popular tools include dotnet-ef (Entity Framework), dotnet-format (code formatting), and various analyzers and generators.
参数
- install _PACKAGE_
- Install tool package.
- list
- List installed tools.
- update _PACKAGE_
- Update tool to latest version.
- uninstall _PACKAGE_
- Remove tool.
- restore
- Restore local tools from manifest.
- -g, --global
- Global installation (user-wide).
- --tool-path _PATH_
- Custom installation directory.
- --help
- Display help information.
FAQ
What is the dotnet-tool command used for?
dotnet tool manages .NET CLI tools, which are NuGet packages containing console applications. Tools can be installed globally (user-wide) or locally (project-specific). Global tools are available from any directory and installed in a user-specific location. Local tools are specified in a manifest file (dotnet-tools.json) and installed per-project. Popular tools include dotnet-ef (Entity Framework), dotnet-format (code formatting), and various analyzers and generators.
How do I run a basic dotnet-tool example?
Run `dotnet tool install -g [tool-name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does install _PACKAGE_ do in dotnet-tool?
Install tool package.