dotnet new
The dotnet command that creates a new project, solution or file from a template, such as a console app or a web API.
In more detail
A template is a ready-made starting point: dotnet new console writes a project file and a Program.cs, and dotnet new sln creates an empty solution. Inspect what a template generated before adding code to it.
Example
dotnet new console -n HelloRelated terms
- dotnet CLI — The dotnet command-line tool that creates, restores, builds, runs, tests and publishes .NET projects.
- project file — The XML file, such as Hello.csproj, that tells the build which SDK, target framework, packages and settings a project uses.
- solution — A file (.sln or the newer .slnx) that groups related .NET projects, such as an API, its libraries and its tests, so they can be opened and built together.
- console application — A program that runs in a terminal and reads and writes text, with no web server or graphical window.
Taught in
- What is .NET? Runtime vs SDK, and LTS vs STS — Modern .NET Core, C# & Enterprise Microservices
- Solutions, Projects, and Target Frameworks — Modern .NET Core, C# & Enterprise Microservices