Welcome to the .NET Core Commands section! This document provides a comprehensive collection of .NET Core commands to assist developers in various aspects of .NET Core application development.
dotnet new console -n YourProjectName
: Create a new .NET Core console project.dotnet new web -n YourWebProjectName:
: Create a new .NET Core web project.dotnet new classlib -n YourLibraryName
:Create a new .NET Core class library. Replace YourProjectName, YourWebProjectName, or YourLibraryName with your desired project or library name.
dotnet build
: Build the .NET Core project.dotnet run
: Run the .NET Core application.
dotnet restore
: Restore project dependencies.dotnet clean
: Clean the project and remove build artifacts.dotnet add package YourPackageName
: Add a NuGet package reference.dotnet add package YourPackageName --version x.x.x
: Add a specific version of a NuGet package.dotnet add package YourPackageName --version "*"
: Add the latest version of a NuGet package. Replace YourPackageName with the desired NuGet package name.
dotnet --version
: Display the installed .NET SDK version.dotnet list reference
: List project references.dotnet test
: Run unit tests.dotnet publish -c Release -r win10-x64
: Publish the application for Windows x64.
Feel free to contribute by opening issues or pull requests. Your feedback is highly appreciated!