liveBook · Manning

Dotnet new

As explained in Pro ASP.NET Core 7, Tenth Edition

The dotnet new command is a .NET CLI command that creates projects, configuration files, and solution files from templates.

dotnet new creates .NET projects, configuration files, and solution files from templates. In ASP.NET Core, it establishes the starting structure and configuration for application development. section 3.3 section 4.1.1

Useful template targets include:

  • web creates the minimum configuration and content required for ASP.NET Core development. section 4.1.1

Create a .NET 7 project and solution

dotnet new globaljson --sdk-version 7.0.100 --output MySolution/MyProject dotnet new web --no-https --output MySolution/MyProject --framework net7.0 dotnet new sln -o MySolution dotnet sln MySolution add MySolution/MyProject

Templates accelerate setup but embed configuration assumptions. The minimal web template is a useful learning starting point because later customization remains visible. section 4.1.1

How Pro ASP.NET Core 7, Tenth Edition covers it

How deep it goes
Explains template selection and runnable creation commands, while stopping short of template internals.
Examples
Demonstrates template listing, a .NET 7 web project, global.json, a solution file, and adding the project to the solution.
What it assumes
Assumes access to the dotnet command and a PowerShell prompt, while introducing template selection and project organization.
What you can do after
Apply it via the .NET CLI to create and organize an ASP.NET Core project from selected templates.
How it connects
Connects project templates with ASP.NET Core, solution files, global.json, SDK versions, and subsequent build and run commands.

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 Pro ASP.NET Core 7, Tenth Edition. The section links point to the parts of the book it draws on.