Last updated
Was this helpful?
Last updated
Was this helpful?
The .NET command-line interface (CLI) is a cross-platform toolchain for developing, building, running, and publishing .NET applications. The .NET CLI is included with the .NET SDK.
→ ,
Examples:
dotnet new webapi --output src/PalTracker --name PalTracker
will use the template "ASP.NET Core Web API"
dotnet new xunit --output test/PalTrackerTests --name PalTrackerTests
will use the template "xUnit Test Project"
dotnet new sln --name PalTracker
will use the template "Solution File"
Examples:
dotnet add test/PalTrackerTests reference src/PalTracker/PalTracker.csproj
dotnet add test/PalTrackerTests package Microsoft.AspNetCore.TestHost --version 2.2.0
Examples:
dotnet sln PalTracker.sln add src/PalTracker/PalTracker.csproj
Examples:
dotnet run --project src/PalTracker
Examples:
dotnet publish src/PalTracker --configuration Release
Examples:
dotnet test test/PalTrackerTests --filter PalTrackerTests.InMemoryTimeEntryRepositoryTest
See also:
dotnet add reference
Adds project-to-project (P2P) references (see docs.microsoft.com)
dotnet add package
Adds a package reference to a project file (see docs.microsoft.com)
dotnet sln
Modifies a .NET Core solution file (see docs.microsoft.com)
dotnet run
Runs source code without any explicit compile or launch commands (see docs.microsoft.com)
dotnet publish
Packs the application and its dependencies into a folder for deployment to a hosting system (see docs.microsoft.com)
dotnet test
Run the tests (see docs.microsoft.com)
dotnet -v
Display information on the installed version
dotnet new
View the available templates (see docs.microsoft.com)