LinuxCommandLibrary

dotnet-run

build and execute .NET projects

TLDR

Run current project

$ dotnet run
copy
Run with arguments
$ dotnet run -- [arg1] [arg2]
copy
Run specific project
$ dotnet run --project [path/to/project.csproj]
copy
Run in Release configuration
$ dotnet run -c Release
copy
Run without building
$ dotnet run --no-build
copy
Run specific framework
$ dotnet run -f [net8.0]
copy

SYNOPSIS

dotnet run [options] [-- args]

DESCRIPTION

dotnet run builds and executes a .NET project in one step. It's the standard way to run applications during development without creating deployment artifacts.
The double-dash separates dotnet options from arguments passed to the application. Launch profiles in launchSettings.json can configure environment variables and arguments for development scenarios.
For web applications, dotnet run starts the development server with hot reload support in newer versions.

PARAMETERS

--project PATH

Project to run.
-c, --configuration CONFIG
Build configuration.
-f, --framework FRAMEWORK
Target framework.
--no-build
Run without building first.
--no-restore
Skip package restore.
--launch-profile NAME
Launch profile to use.
-- ARGS
Arguments to pass to application.
--help
Display help information.

CONFIGURATION

Properties/launchSettings.json

Configures launch profiles with environment variables and application arguments.

CAVEATS

Includes build time in execution. Use --no-build for faster iteration. Launch profiles only work from project directory. Not intended for production use.

HISTORY

dotnet run is part of the .NET CLI providing streamlined development iteration. It combines build and execution, improving developer experience over separate compile-then-run workflows.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community