Today, I'm sharing a list of super useful terminal commands that can simplify your daily work in C#/.NET and boost your productivity. Whether youβre navigating folders, managing projects, or running .NET applications, these commands have you covered. Letβs dive in! π»
π² Basic Navigation and File Commands
-
ls- Lists all folders and files in the current directory. -
mkdir <foldername>- Creates a new folder with the specified name. -
cd <foldername>- Changes the directory to the specified folder.
π οΈ Creating and Managing .NET Projects
-
dotnet new sln- Creates a new solution file for managing projects. -
dotnet new console -n <projectname>- Creates a new console application project. You can change<projectname>to any name you like! -
dotnet sln add <projectname>- Adds a created project to your solution file for easy management.
π Building and Running Your Project
-
dotnet build- Builds your .NET project, checking for errors and preparing it to run. -
dotnet run- Runs the .NET project youβve built, helping you quickly test it.
π Additional Handy Commands
-
dotnet restore- Restores dependencies and project-specific tools, useful if you have a*.csprojfile with NuGet packages to manage. -
dotnet clean- Cleans up the build output, often used before building a fresh version of your project. -
dotnet publish -c Release- Publishes your project in Release mode, optimizing it for deployment.
With these commands in your toolkit, navigating projects and managing your C#/.NET solutions in the terminal becomes a breeze! π¬οΈ Happy coding! π¨βπ»π©βπ»
Top comments (0)