In this article, we will learn about the Project Structure of the ASP.NET Core 3.1 Web Application. This is the continuation of the ASP.NET 3.1 Tutorials series. I will recommend you to go through the below article of this series if not already gone through that:
As in the previous article, we created an empty ASP.NET Core Project and the structure of the project is as shown in the below image.Let’s start exploring each folder and file that exists in the Project Structure for ease of understanding.
.csproj File: Right-click on the project and then click on Edit Project File in order to edit the .csproj file (In .NET Framework we can’t see that option until the project is unloaded from the solution explorer and the content of .csproj was quite difficult to understand).
Once clicked on Edit Project File, .csproj file will be opened in Visual Studio as shown below.
As you can see TargetFramework element specifies the target framework of our ASP.NET Core application. Netcoreapp3.1 is the TFM that stands for the Target Framework Moniker. On adding the dependencies through NuGet, it will add another ItemGroup element which contains the details of the Package in PackageReference element.
launchSettings.json: Properties folder contains a file i.e. launchSettings.json file which contains all the information required to launch the application. It contains the profiles through which the application can be run, each profile is mapped to a commandName, applicationUrl on which application is launched, environmentVariables, etc.
As you can see, In the above launch setting we have two profiles. One will launch the application on IIS Express and another through the Kestral Server (used in the case when the application is run through the DotNet CLI or profile is selected through the Visual Studio Launch icon).appsettings.json: In .Net Framework, we store application-level settings or configuration in the web.config. In the .Net Core framework, appsettings.json will do the same work. All the connection strings, application-related settings are stores in the appsettings.json file in JSON format.
wwwroot Folder: A wwwroot folder needs to be created in order to serve and store static files like CSS, Javascript, images, icons, etc. We will see its usage when we learn about the Static Files in the upcoming articles of this series.
Another interesting feature of the ASP.NET Core Project that files in the project are sync with the files in the system in real-time. Let say on adding a file through the file explorer in the project (not through Visual Studio), files created/altered immediately reflected in the Solution Explorer window. If we delete any file through file explorer, the file will be deleted immediately from the solution explorer as well. In the older version of .Net Framework, we need to include and exclude files manually if files added/deleted through the windows explorer window.
I hope this article helps you in understanding the basic Folder/Project architecture of the ASP.Net Core project.
Thanks










This article provides a clear walkthrough of the ASP.NET Core 3.1 project structure by explaining the purpose of important files and folders rather than treating the generated project as a black box. The discussion of the .csproj file, launchSettings.json, appsettings.json, Program.cs, Startup.cs, and wwwroot gives beginners a useful understanding of how the different parts of an ASP.NET Core application fit together.
ReplyDeleteUnderstanding the target framework and NuGet PackageReference entries in the .csproj file is particularly useful when working through Dot NET Full Stack Training. The explanation of Program.cs and Startup.cs also makes the application's hosting, service registration, dependency injection, and HTTP request pipeline easier to understand.
The comparison between appsettings.json and the older web.config approach is another helpful point for developers transitioning from .NET Framework to ASP.NET Core. These backend fundamentals are directly applicable when progressing into ASP.NET Core Angular Full Stack Training, where ASP.NET Core provides the server-side foundation.
ReplyDelete