What is CLI in .NET Core?
The dotnet Command Line Interface is a cross-platform command-line tool used for developing and performing various development activities when developing .Net Core applications.
Types of command lines in .NET Core
There are three types of command lines in .NET Core.
- Basic Commands
- Project Modification Commands
- Advanced Commands
List of commands
Below is the list of commands to implement in the project using CLI.
Steps to implement the basic commands
Follow the below steps to implement the basic commands.
Step 1. Open the Run windows by entering Windows + R type cmd in the textbox and click the OK button as shown below.
Step 2. The command prompt window will open.
Step 3. Go to the Command prompt, type dotnet, and press enter key. The user will get all the information as shown in the below image.
Step 4. Go to the Command prompt, type dotnet- -list-SDKs and press enter key. The user will get the SDK path installed information.
Step 5. Go to the Command prompt, type dotnethelp, and press enter key. The user will get the information as shown in the below image.
Steps to create an Asp.Net MVC project using CLI in .Net Core
Follow the below steps to create an Asp.Net MVC project using CLI in .Net Core.
Step 1. Create one folder in any drive with a demo folder, follow the steps as shown in the image below.
Step 2. Whole MVC project structure will be created in the demo folder as shown in the below image.
Step 3. To build the MVC project using CLI write the command dotnet build.
Step 4. To run the MVC project using CLI write the command dotnet run.
Step 5. The application will run on the browser as shown below with default port no: 5001
Summary
I hope you understood this article. We have created an MVC Project using CLI in .Net Core. In my next article, I will explain how to use the advanced command line and add solutions to the project.