Writing and compiling code using the .NET Core CLI tool
When you install Visual Studio 2017, or the .NET Core SDK, a Command Line Interface (CLI) tool named dotnet
is installed as well as the .NET Core runtime.
dotnet
has the following commands that all work on the project in the current folder:
dotnet new console
: creates a new console application projectdotnet new classlib
: creates a new assembly library projectdotnet new web
: creates a new empty ASP.NET Core projectdotnet new mvc
: creates a new ASP.NET Core MVC projectdotnet new webapi
: creates a new ASP.NET Core Web API projectdotnet restore
: downloads dependencies for the projectdotnet build
: compiles the projectdotnet test
: runs unit tests on the projectdotnet run
: runs the projectdotnet ...
Get C# 7 and .NET Core: Modern Cross-Platform Development - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.