1 / 4
2 / 4
3 / 4
4 / 4

Thursday, 7 May 2020

Creating a New Project in ASP .Net Core using CLI, Visual Studio Code, and Visual Studio 2019


We can create an Asp.Net Core project using various ways. In this blog, We are going to discuss 3 ways of creating a new project. We can use Command Line(CLI), Visual Studio Code, and Visual Studio 2019.

Creating a project using CLI

1.Create a Folder on your system (any location)
let me, I have created a folder named "AspCoreUsingCli" on my "D drive",
the path is D:\AspCoreUsingCli
2. Open the Folder path on the Command Prompt

3. Write the code "dotnet new mvc" and hit the "Enter" key.

4. Check the Folder we have created, Project is ready to go. It will create the project-related files and folders automatically as shown below.

Creating a project using Visual Studio Code

1.Create a Folder on your system (any location)
let me, I have created a folder named "AspCoreUsingCode" on my "D drive", the path is D:\AspCoreUsingCode
2. Open the Folder on the Visual Studio Code 
File-> Open Foddel->My Folder("AspCoreUsingCode")
3. Click on Terminal->New Terminal and then write "dotnet new mvc" as given below and hit the "Enter" key.

4. Our project is ready. Check the Folder we have created, It will create the project-related files and folders automatically as shown below.
5. But we can not work on this project because for that we have to install so many Extensions like C#, .Net Core Tool.NuGet Package Manager, etc..
      To open extension window click  on this icon (or) click "Ctrl+Shift+x" (or)
 View->Extensions.

Search for "C#" and .Net Core Tool then install them to work on that .Net Core Project.
*we will later discuss how to work and what extensions we have to install particularly for this project.


Creating a project using Visual Studio 2019


1. Open Visual Studio 2019
2. Click on "Create a new project"
3. In his interface, We can see a list of templates. We have to find the Asp .Net Core Web template by searching from the search box or by selecting the items from 3 dropdown lists with C#, All Platforms, Web combination as shown here. Then click "Next".
Asp.Net Core Template










4. Now give the Project Name, Location, and Solution Name as shown below. Here My Project name is "AspCoreUsingStudio", here my project name and the solution name is the same and the location is D drive "D:\AspCoreUsingStudio".Then click "Create".













5. Now we can select the "Empty" or"Web Application" template but we want here the related folders to our project so better to select the "Web Application(Model-View-Controller)" template rather than creating manually for this post. Make sure the Checkbox "Configure HTTPS" is not selected for now. Then click"Create".
Now the project is ready to go with its required Folder and files. But to work with our project we have to install some other packages from the NuGet package manager.

The Video Description for this session is here.
Coming Soon...

Click here to go to our Youtube channel.


I will use Visual Studio 2019 . If anyone will give the interest in showing to work with VS Code then I will show the examples with VSCode.
In the next session, we will discuss what are those Folders and Files. 

1 comment:

  1. Another of the many benefits or stars to making your own YouTube recordings is that it is moderately simple to do. Obviously, you should have a video recording gadget. https://www.buyyoutubeviewsindia.in/youtube-marketing/

    ReplyDelete

If you have any doubts please let me know