liveBook · Manning

Dotnet new

As explained in .NET in Action, Second Edition

dotnet new list is a .NET CLI command that displays the project templates installed for use by dotnet new.

dotnet new is a .NET CLI command for creating applications from installed project templates. Its list form, dotnet new list, displays the templates currently available for use. section 2.9 section 4.1.1

Use the command in these production-oriented workflows:

  • Run dotnet new list after installing or updating a custom template to confirm that the template is available. section 4.1.1
  • Create a project by selecting a template and supplying its options, such as dotnet new console --name HelloDotNet. section 2.1
  • Use dotnet --help for available CLI commands and dotnet new --help for command-specific guidance. section 2.1
  • Use built-in templates for console applications, web APIs, and test projects. section 2.1 section 12.1

Checking and using a custom template

Build and install a template with dotnet build and dotnet new install ., then run dotnet new list to check that it appears. Create projects from it in another folder with dotnet new. section 4.1.1

Listing 2.1 Command to create web API from template
dotnet new console --name HelloDotNet

See a focused project-creation command using the console template and a project name. section 2.1

How .NET in Action, Second Edition covers it

How deep it goes
Explains command use through creation, help, installation, and verification workflows without detailing CLI implementation internals.
Examples
Uses console, web API, xUnit, and custom command-line templates as concrete project-generation examples.
What it assumes
Assumes a terminal and .NET SDK, while demonstrating project creation without requiring an existing application.
What you can do after
Operate the .NET CLI to inspect installed templates, create projects, and verify custom-template installation.
How it connects
Connects .NET CLI commands with the .NET SDK, project templates, console applications, web APIs, and test projects.

Also explained in

Compare how 3 books explain dotnet new →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET in Action, Second Edition. The section links point to the parts of the book it draws on.