New in .NET 10.0 [22]: Start SDK tool extensions directly
In .NET 10.0, you can start extensions for the .NET SDK without prior installation.
(Image: Pincasso/Shutterstock.com)
- Dr. Holger Schwichtenberg
Previously, tool extensions for the .NET SDK command-line tool dotnet.exe (or dotnet) had to be installed locally in a project from NuGet, for example:
dotnet tool install dotnet-runtimeinfo
or installed globally:
dotnet tool install -g dotnet-runtimeinfo
before execution with
dotnet-runtimeinfo
was possible.
Since .NET 10.0, developers can download and execute such a tool once without saving it locally. For this, there is the new command dotnet tool exec. This is how it works, for example:
dotnet tool exec dotnet-runtimeinfo
Videos by heise
Before the first execution, there will be a prompt asking if you really want to start the tool (see Figure 1). This prompt can be answered with “yes” in advance by specifying -y or --yes:
dotnet tool exec dotnet-runtimeinfo -y
Additionally, you can abbreviate dotnet tool exec with dnx:
dnx dotnet-runtimeinfo -y
Those who have been around for a while will remember that in the early days of .NET Core there was already a tool called dnx.exe, which was later renamed to dotnet.exe. Microsoft keeps open in the Release Notes for .NET 10.0 Preview 6 the possibility to use the name dnx more strongly in the future: “The actual implementation of the dnx command is in the dotnet CLI itself, so we can evolve its behavior over time. Today it runs tools, but who knows what the future may hold.”
(afl)