← All notes

Using the .NET CLI

Summary

The .NET CLI ships with the SDK. From a terminal it develops, builds, runs, and publishes apps. Every invocation is the dotnet driver, then either a path to a framework-dependent DLL or a command with arguments and options. dotnet new writes a project or other file from a template.

Driver, command, arguments

The overview applies to the .NET Core 3.1 SDK and later. dotnet my_app.dll runs the app when you are in its folder. dotnet build runs a command. The driver picks an SDK first. With no global.json, that is the latest SDK installed. Arguments go to the command: dotnet publish my_app.csproj publishes that project. Options do too: --output sets the publish folder. A short path shown in the docs is dotnet new console, then dotnet build --output ./build_output, then dotnet on the built DLL.

Default commands include new, build, publish, run, test, pack, clean, and watch. Further commands add packages, talk to NuGet, manage workloads, and install tools (console apps from NuGet). new, build, run, test, publish, and pack restore on their own. --no-restore disables that.

dotnet new

The new-command page applies to the .NET 6 SDK and later. The template engine writes the files. dotnet new list shows installed templates. The search subcommand looks on NuGet.org. dotnet new console -h is help for one template.

From the .NET 7 SDK, list, search, install, and uninstall are subcommands. --dry-run previews a create. --force overwrites existing files. --language accepts C#, F#, or VB when the template allows it; quote F# if the shell treats # specially. --name defaults to the current directory name. --framework writes a target framework moniker such as net6.0. --output defaults to the current directory. --no-update-check skips a template-package update check. Default templates are not checked that way from the .NET 6 SDK.

Examples on the page: dotnet new console for C#, the same template with --language "F#" for F#, dotnet new classlib with a framework and -o for a library in another directory, dotnet new mvc -au None, dotnet new xunit, and dotnet new globaljson to pin an SDK version in the current directory.

Claims

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Microsoft Learn, .NET CLI overview, CC BY 4.0 (dotnet/docs); Microsoft Learn, dotnet new <TEMPLATE>, CC BY 4.0 (dotnet/docs).

Cite this

Permanent ID: iil:note:39nknn6w

iinventedlight. 2026. "Using the .NET CLI." iinventedlight Library, iil:note:39nknn6w, version of 2026-11-03. https://iinventedlight.com/library/notes/dotnet-cli-basics/. License: CC-BY-4.0.

@misc{iil_note_39nknn6w,
  author = {{iinventedlight}},
  title = {{Using the .NET CLI}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-03},
  url = {https://iinventedlight.com/library/notes/dotnet-cli-basics/},
  note = {Permanent ID iil:note:39nknn6w. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/dotnet-cli-basics.md.