本文 适用于: ✔️ .NET Core 3.1 SDK 及更高版本
Name
dotnet tool run - 调用本地工具。
概要
dotnet tool run <COMMAND NAME> [--allow-roll-forward]
dotnet tool run -h|--help
Description
命令 dotnet tool run 搜索当前目录范围内的工具清单文件。 当它找到对指定工具的引用时,它将运行该工具。 有关详细信息,请参阅 调用本地工具。
Arguments
COMMAND_NAME要运行的工具的命令名称。
选项
--allow-roll-forward从 .NET 9.0 SDK 开始可用。 如果未安装面向的运行时,允许工具使用较新版本的 .NET 运行时。
-?|-h|--help输出有关如何使用命令的说明。
Example
dotnet tool run dotnetsaydotnetsay运行本地工具。dotnet tool run dotnetsay --allow-roll-forwarddotnetsay运行本地工具,并允许它在较新的 .NET 版本上运行(如果目标运行时不可用)。