Create a new project from the command line


It's possible to create a new ASP.NET Core project entirely from the command line using the dotnet command.

dotnet new web
dotnet restore
dotnet run

dotnet new web scaffolds a new "empty" web project. The web parameter tells the dotnet tool to use the ASP.NET Core Empty template. Use dotnet new -all to show all the available templates currently installed. Other key templates include console, classlib, mvc and xunit.

Once the template has been scaffolded out, you can restore the packages required to run the project (dotnet restore), and compile and start it (dotnet run).

Once the project is running, it will be available on the default port: http://localhost:5000