My Top Dotnet Command Snippets

Vhspiceros
Jun 28, 2024

--

Photo by Gabriel Heinzer on Unsplash

Here are some top dotnet command snippets I have use frequently , working with dotnet core in Linux, mac and windows:

Create a new console application:

https://learn.microsoft.com/es-es/dotnet/core/tools/dotnet-new#arguments

dotnet new console -n MyApp

Build a project:

dotnet builds

Run a project:

dotnet run

Test a project:

dotnet test

Publish a project for a specific runtime:

dotnet publish -c Release -r win10-x64
## other example
dotnet publish -c Debug -o ./publish --framework net6.0 folder/project.csproj

Add refererence a project :

dotnet add app/app.csproj reference lib/lib.csproj ## project

Add NuGet package:

dotnet add package Newtonsoft.Json

Important: These command working only with .net Core.


Atte.
Victor Hugo Saavedra
http://vhspiceros.blogspot.com

Originally published at http://vhspiceros.blogspot.com on June 28, 2024.

--

--

No responses yet