The Roadmap for learning ASP.NET Core
- ASP.NET Core Application Life Cycle
- Fundamentals
- Data Access Technology
- EF Core
- Dapper
- Working with individual ASP.NET Core project types.
- ASP.NET Core Razor
- ASP.NET Core MVC
- ASP.NET Core web API
- ASP.NET Core Blazor
- ASP.NET Core Identity
We are on a beautiful journey of learning ASP.NET Core and I congratulate you for successfully completing the first step. Please clap for yourself and pat your back.
In this section, I will give you an overview of key topics for understanding how to develop ASP.NET Core applications.The concepts that we will learn in the fundamental section, will be applicable to each ASP.NET Core project type such as ASP.NET Core Razor, ASP.NET Core MVC, ASP.NET Core Web API, and ASP.NET Core Blazor. So, I highly recommend you to learn these concepts with a full concentration.
Let's start by creating an empty ASP.NET Core project and analyzing the directory structure. We can either use a visual studio or dotnet CLI for creating, building, and running an ASP.NET Core project. After creating the project with dotnet CLI, you can open it in any of your favorite text editors like Sublime or VS Code.
If you are a fan of visual studio code then open the command prompt and copy-paste the below commands.
c:\> mkdir ASPNETCoreLearning // creating a directory "ASPNETCoreLearning"
c:\> cd ASPNETCoreLearning // change directory to (Entering into) "ASPNETCoreLearning"
c:\ASPNETCoreLearning >dotnet new web DirectoryStructureDemo //creating empty web project
c:\ASPNETCoreLearning\ DirectoryStructureDemo > code . // open folder in VSCode
- Note!
- dotnet new - Creates a new project, configuration file, or solution based on the specified template(ex: MVC, Razor etc).
- dotnet build - Builds a project and all of its dependencies.
- dotnet run - Runs source code without any explicit compile or launch commands.
- dotnet new web - creates a new ASP.NET Core empty project
- dotnet new mvc - creates a new ASP.NET Core MVC project
- dotnet new razor - creates a new ASP.NET Core Razor project
- dotnet new webapi - creates a new ASP.NET Core Web API project
- dotnet new blazorserver - creates a new ASP.NET Core Blazor Server project
- dotnet new blazorwasm - creates a new ASP.NET Core Blazor Client project
If you are a visual studio lover like me, then open visual studio and follow the steps as shown below.
- step 1. Click on "create a new project" on the first window.
- step 2. On the next window, select "ASP.NET Core Empty template" from available templates.
- step 3. configure the project by giving a "project name" and selecting the directory location.
- step 4.On the addition information window, select the "Target framework (.NET 5)", uncheck the HTTPs checkbox for now, check the checkbox to enable the razor runtime compilation, and click create.
At this moment visual studio or dotnet CLI will successfully create an empty ASP.NET Core project, we can see the created files and folder in the solution explorer of visual studio or VS Code.
These files and folders are common for all ASP.NET Core project types. For a specific project type, only the folders that are specific to that project type will be added to the solution like Model, view and controller folders will be some of the additional folders for an MVC application , similarly Pages folder will be an additional folder for a Razor application.
When we start working on a project we rarely touch the files like applicationName.csproj, launchSettings.json and Program.cs, on the other hand , Startup.cs and appsettings.json file are the ones where a developer spent their most of the time. However, each of the files and folder present in the solution has a specific role and we should know the purpose of each of them. Even if the project file (
We will discuss each of these files one by one and in a great depth from the next article.