Commonly used commands for .net Core Good to remember

by | Sep 6, 2023 | .Net Core, Learn | 0 comments

Most userful commands for .net Core. Good to remember.

  1. 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

  2. dotnet clean: This command cleans the output directories and removes any previously generated build artifacts, binaries, and temporary files.

    Example: dotnet clean

  3. 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

  4. 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

  5. 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

  6. 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

  7. 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

Related Posts

.Net Core vs .Net Framework differences

CLR vs Core CLR What is CoreCLR The CoreCLR provides many similar functionalities as the CLR, but it is specifically designed for the cross-platform nature of .NET Core. General CLR feature includes features like Just-In-Time (JIT) compilation, garbage collection,...

Understand Middleware in .Net Core

Middleware is a piece of software that handles http request and response. In simple term, .net core works with middleware in order to enhance performance of our application rather than having big chunk of framework component/ libraries at once, for which most of the...

Learn How .Net Core Hosting Works

Hosting In .NET CoreIn ASP.NET Core, there are two hosting models available: in-process hosting and out-of-process hosting.In-process Hosting (Default): In the in-process hosting model, a single web server (e.g., IIS) is used directly to host the application. To...