Forrest logo
back to the dotnet tool

dotnet:tldr:246ce

dotnet: Build and execute the .NET project in the current directory.
$ dotnet run
try on your machine

The command "dotnet run" is used to compile and execute a .NET application from the command line.

Here is a breakdown of what each part of the command does:

  • "dotnet": It is the command-line tool for .NET Core. It provides several commands to build, run, and manage .NET applications.

  • "run": It is one of the commands available in the "dotnet" tool. When you use the "run" command, it compiles the application (if needed) and executes the compiled code.

When you run "dotnet run" from the command line, the following steps occur:

  1. It checks whether the project has already been built. If not, it compiles the project.

  2. After successful compilation, it launches the compiled application.

Note that "dotnet run" should be executed within the root folder of the project, where the project file (usually with a .csproj extension) is located.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the dotnet tool