Code and prod logo

Code and Prod Complet Projects

Follow me

EL JIHAOUI
QUICK ACCESS

Create New Project .NET7

Create New Project DotNet 7

Table of Contents

CLI : Command-Line Interface

The .NET command-line interface (CLI) is a cross-platform toolchain for developing, building, running, and publishing applications.

The .NET CLI is included with the .NET SDK and it is available on Windows, macOS, and Linux.

CLI contains the commands that allow us to createcompile and run a .NET project, in our project we will frequently use the following commands :

  • new : dotnet new – Creates a new project.
  • build: dotnet build – Builds a project and all of its dependencies.
  • run : dotnet run – Runs source code without any explicit compile or launch commands.
  • publish : dotnet publish – Publishes the application and its dependencies to a folder for deployment to a hosting system.
  • add package : dotnet add package – Adds or updates a package reference in a project file.
  • etc ….

Create new project 

To create a .net 7 project using CLI, we will use the dotnet new command, but we must specify a template for this command. 

To list all the templates we must execute the following command:

				
					dotnet new list
				
			

This command lists all the templates available in .NET SDK as shown in the following picture.

dotnet-new-list

We will create a console project named “EFCoreNET7App” using the following command

				
					dotnet new console -o EFCoreNET7App
				
			

After executing this command, our project is created, to open it with Visual Studio Code, we must change the directory to “EFCoreNET7App” with the command “cd EFCoreNET7App” and type the following command :

				
					code .
				
			

And your project will be shown in visual studio code editor like this :

project-dotnet-visual-studio-code

Course Video

if you like it share it please

Facebook
LinkedIn
Twitter
Related Posts
Data Seeding in migration using EF Core
Entity Framework Core
EL JIHAOUI

Data seeding

Data seeding is a process where you populate a database with an initial set of data
There are

Read More »

MORE RESSOURCES