Articles → ASP.NET CORE → Create Your First Asp.Net Core Project

Create Your First Asp.Net Core Project






Why Asp.Net Core?





Create Your First Asp.Net Core Application




  1. Open visual studio 2019
  2. Click on "File" → "New" → "Project…"
  3. A popup window will appear. Click on the option "ASP.NET Core Web Application" and then click on the "Next" button
  4. Picture showing the asp.net core web application template while creating the new project
    Click to Enlarge

  5. A window will appear to enter the "Project name" and "Location". Once the "Project name" is entered, click on the "Create" button
  6. Picture showing a window to enter the solution and the project name
    Click to Enlarge

  7. In the next window, select the type of .net core application. For this example, we will create a "Web Application"
  8. Picture showing the list of application types that asp.net core provides
    Click to Enlarge

  9. Click on the "Create" button to create a new application

Project Structure




Picture showing the project structure of the asp.net core project
Click to Enlarge



  1. wwwroot folder → This folder contains the static file i.e., script, style, image and static HTML files
  2. Page Folder → This folder contains the view, page model and layout files
    1. Shared Folder → This folder contains 2 files: -
      1. _Layout.cshtml - This is the layout (or master) page
      2. ii _ValidationScriptsPartial.cshtml - This script file is required for validations in asp.net core project
    2. _ViewImports.cshtml → This file contains the code to include tag helpers in the project
    3. _ViewStart.cshtml → This file tells the project about which layout (or master page) is included in every project
    4. Views file → The files "Index.cshtml" and "Privacy.cshtml" are the view files. These files are used for creating UI
    5. Page Model files → The files "Index.cshtml.cs" and "Privacy.cshtml.cs" are the page model files for writing the business logic



Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, February 17, 2021

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250