Most userful commands for .net Core. Good to remember.
- dotnet new: This command is used to create a new project based on a specified template. It generates the basic structure and files required for a .NET Core application.
Example:
dotnet new console - dotnet clean: This command cleans the output directories and removes any previously generated build artifacts, binaries, and temporary files.
Example:
dotnet clean - dotnet test: This command runs the unit tests in your .NET Core application using a testing framework like xUnit, NUnit, or MSTest.
Example:
dotnet test - dotnet watch: This command runs your application and automatically restarts it whenever changes are detected in the source code files. It’s useful for development and enables hot-reloading.
Example:
dotnet watch run - dotnet ef: This command is used for Entity Framework Core migrations and database operations. It allows you to create, apply, and manage database migrations.
Example:
dotnet ef migrations add MyMigration - dotnet add: This command is used to add new items to your .NET Core project, such as references to NuGet packages, project references, or files.
Example:
dotnet add package Newtonsoft.Json - dotnet remove: This command is used to remove items from your .NET Core project, such as references to NuGet packages, project references, or files.
Example:
dotnet remove package Newtonsoft.Json
0 Comments