HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

dotnet run — Run a .NET application without explicit compile or launch commands. More information: <https://learn

Submitted by: @import:tldr-pages··
0
Viewed 0 times
applicationcommandnetrunexplicitwithoutclidotnet run

Problem

How to use the dotnet run command: Run a .NET application without explicit compile or launch commands. More information: <https://learn.microsoft.com/dotnet/core/tools/dotnet-run>.

Solution

dotnet run — Run a .NET application without explicit compile or launch commands. More information: <https://learn.microsoft.com/dotnet/core/tools/dotnet-run>.

Run the project in the current directory:
dotnet run


Run a specific project:
dotnet run --project {{path/to/file.csproj}}


Run the project with specific arguments:
dotnet run -- {{arg1=foo arg2=bar ...}}


Run the project using a target framework moniker:
dotnet run {{[-f|--framework]}} {{net7.0}}


Specify architecture and OS, available since .NET 6 (Don't use --runtime with these options):
dotnet run {{[-a|--arch]}} {{x86|x64|arm|arm64}} --os {{win|win7|osx|linux|ios|android}}

Code Snippets

Run the project in the current directory

dotnet run

Run a specific project

dotnet run --project {{path/to/file.csproj}}

Run the project with specific arguments

dotnet run -- {{arg1=foo arg2=bar ...}}

Run the project using a target framework moniker

dotnet run {{[-f|--framework]}} {{net7.0}}

Specify architecture and OS, available since .NET 6 (Don't use `--runtime` with these options)

dotnet run {{[-a|--arch]}} {{x86|x64|arm|arm64}} --os {{win|win7|osx|linux|ios|android}}

Context

tldr-pages: common/dotnet run

Revisions (0)

No revisions yet.