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.

listen Print view
Traffic sign with inscription .NET

(Image: Pincasso/Shutterstock.com)

2 min. read
By
  • 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
The Dotnet Doctor – Holger Schwichtenberg
Der Dotnet-Doktor – Holger Schwichtenberg

Dr. Holger Schwichtenberg is the technical director of the expert network www.IT-Visions.de, which supports numerous medium-sized and large companies with consulting and training services as well as software development, drawing on the expertise of 53 renowned experts. Thanks to his appearances at numerous national and international conferences, as well as more than 90 specialist books and over 1,500 specialist articles, Holger Schwichtenberg is one of the best-known experts for .NET and web technologies in Germany.

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

dotnet tool exec asks for confirmation before execution (Fig. 1).

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)

Don't miss any news – follow us on Facebook, LinkedIn or Mastodon.

This article was originally published in German. It was translated with technical assistance and editorially reviewed before publication.