.NET CLI Flags & Options
The dotnet command for building and running .NET apps.All .NET CLI pages
- dotnet build -c Release: build the Release configuration instead of Debugdotnet build -c Release builds the Release configuration: optimised, no DEBUG symbol, output in bin/Release. Defaults per command, conditions in csproj.
- dotnet publish -p:PublishSingleFile=true: publish one executable filedotnet publish -r linux-x64 -p:PublishSingleFile=true bundles the app into one executable. Self-contained bundles, native libraries, compression, pitfalls.
- dotnet publish -r linux-x64 --self-contained: include the .NET runtime in the appdotnet publish -r linux-x64 --self-contained bundles the .NET runtime with the app. Framework-dependent vs self-contained output, RIDs, trimming and pitfalls.
- dotnet run --project PATH: run a project from another directorydotnet run --project PATH builds and runs a project from another folder, avoiding Couldn't find a project to run. Arguments after --, launch profiles.