liveBook · Manning

Dotnet new

As explained in ASP.NET Core in Action, 3e

dotnet new is a .NET CLI command that creates projects from installed templates.

dotnet new creates a .NET application from an installed template. It provides a command-line alternative to Visual Studio for starting ASP.NET Core projects on any platform. section 23.3.1 section 27.1.1

Create a Razor Pages app with Identity

Run `dotnet new webapp -au Individual` to create a Razor Pages application with individual user accounts. This template uses SQLite by default; add `--use-local-db` to use LocalDB instead. Apply the included database migrations with `dotnet ef database update` before creating users. section 23.3.1

Use dotnet new as the first step in the standard CLI workflow:

  • Create the project with a template. section 27.1.1
  • Restore NuGet packages, build the project, and run the application with `dotnet restore`, `dotnet build`, and `dotnet run`. section 27.1.1

How ASP.NET Core in Action, 3e covers it

How deep it goes
Demonstrates template creation and options, but defers template customization and deployment to later commands.
Examples
Uses `dotnet new webapp -au Individual`, SQLite or LocalDB selection, and a generated Razor Pages login application.
What it assumes
Assumes the .NET SDK is installed and teaches project creation before requiring database migration commands for registered users.
What you can do after
Build a starter ASP.NET Core application from the command line and select its authentication and database configuration.
How it connects
Connects .NET CLI projects with ASP.NET Core, templates, NuGet packages, and Entity Framework Core migrations.

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 ASP.NET Core in Action, 3e. The section links point to the parts of the book it draws on.