Ultimate dotnet cli Cheat Sheet for developers
Hey command line fellas, are you a cmd person rather than 10 Clicks using GUI, then this is for you. The below list also helps me to work on large scale applications using just vscode.
dotnet new
dotnet new sln- Solution Filedotnet new console- Console Applicationdotnet new classlib- Class librarydotnet new mvc- ASP.NET Core Web Appdotnet new xunit- XUnit test projectdotnet new l- Obtain complete list of available templates
dotnet sln
dotnet sln list- List all projects in a solution filedotnet sln mySolution.sln add myProject/myProject.csproj- Add a C# project to a solutiondotnet sln mySolution.sln remove myProject/myProject.csproj- Add a C# project to a solutiondotnet sln todo.sln add **/*.csproj- Add multiple C# projects
dotnet sln
dotnet run- Run the project in the current directorydotnet run --project ./projects/helloWorld/helloWorld.csproj- Run the specified projectdotnet myapp.dll- Run a framework-dependent app named myapp.dll
dotnet clean
dotnet clean- Clean the output of a projectdotnet clean --configuration Release- Clean a project built using the Release configuration
dotnet publish
dotnet publish- Publish the project in the current directorydotnet publish ~/projects/myApp/myApp.csproj- Publish the application using the specified project file
dotnet pack
dotnet pack- Build the project and create NuGet packagesdotnet pack --no-build --output nupkgs- Pack the project but skip the builddotnet pack /p:PackageVersion=3.0.0- Set the package version while pack