Learn dotnet CLI(Command Line Interface for .Net Core)

Command Description
new                 Initialize .NET projects.
restore         Restore dependencies specified in the .NET project.
build         Builds a .NET project.
publish         Publishes a .NET project for deployment (including the runtime).
run                 Compiles and immediately executes a .NET project.
test                 Runs unit tests using the test runner specified in the project.
pack         Creates a NuGet package.
migrate         Migrates a project.json based project to a msbuild based project
clean         Clean build output(s).
sln                 Modify solution (SLN) files.
Project modification commands
add                 Add items to the project
remove         Remove items from the project
list                 List items in the project
Advanced Commands
nuget         Provides additional NuGet commands.
msbuild         Runs Microsoft Build Engine (MSBuild).
vstest         Runs Microsoft Test Execution Command Line Tool.

The .NET Core command-line interface (CLI) is a cross-platform for developing, building, running, and publishing .NET Core applications.

CLI commands
There are some commands which are installed by default:
Now go to cmd command prompt and type dotnet --help and enter.
Examples
Run the project in the current directory:
dotnet run
Run the specified project:
dotnet run --project ./projects/proj1/proj1.csproj
Run the project in the current directory (the --help argument in this example is passed to the application, since the blank -- option is used):
dotnet run --configuration Release -- --help
Restore dependencies and tools for the project in the current directory only showing minimal output and then run the project: (.NET Core SDK 2.0 and later versions):
dotnet run --verbosity m

Post a Comment

0 Comments