ASP.NET Core MVC Tutorial – Session 4 – Project File Structure

ASP.NET Core Tutorial Session 4

In this session we are going to talk about the structure of Project file, in different types of ASP.NET application. We show you the structure of Project file in ASP.NET Framework 4.x, ASP.NET Core, ASP.NET 5.0 and talk about how to update this file as well. Based on our application target framework, in Project file inside this block <TargetFramework></TargetFramework> you can see Target Framework Moniker(TFM). Below chart presents abbreviation and TFM (Target Framework Moniker) of different ASP.NET versions.

Abbreviation and TFM of different ASP.NET versions in project file

ASP.NET Framework 4.7.2 Project file

In previous versions of ASP.NET, in order to visit and edit the Project file, first you had to Unload the project. For this purpose, you should right click on project in Solution Explorer, then select Unload the project. After Unloading the project, you can edit the Project file with right click on considered project in Solution explorer and select Edit Project File. In the following image, you can see a part of Project file including TargetFrameworkVersion.

Project file structure in ASP.NET Framework 4.7.2

As you see in above chart, in ASP.NET Framework 4.x Project file, the version of framework has been mentioned in respective Tag. In this type of project, it is not possible to Delete or Add file or folder through File Explorer directly. We will explain more about this, in this session video tutorial.

ASP.NET Core 3.1 and ASP.NET 5.0 Project file

Generally in ASP.NET Core and ASP.NET 5.0, there is no need to Unload the project to edit its Project file. We can edit the Project file by right clicking on project in Solution Explorer then select Edit Project File directly. Project file extensions varied according to different programming language. For example, if you choose C#, the Project file extension will be csproj but, by choosing Visual Basic as a programming language, the Project file extension will be vbproj. In below image, you see the Project file of ASP.NET 5.0 and ASP.NET Core 3.1 framework.

ASP.NET 5.0 Project file framework
ASP.NET 5.0 Project file
ASP.NET Core 3.1 Project file framework
ASP.NET Core 3.1 Project file

As you see, the structure of Project file in ASP.NET Core 3.1 and ASP.NET 5.0 framework is similar to each other and according to chart, the TFM is mentioned in the Project file. Also this file has less details comparing to previous versions of ASP.NET version Project file. Files, folders and structure has not been referenced in this version of ASP.NET Project file. In Project file in addition to TFM, installed packages of each application mention in <ItemGroup></ItemGroup>, but as we have not added any packages in our project yet, we have nothing in this part right now.
Other option of this framework is possibility of Add and Delete files and folders directly in project by means of File Explorer.

If you need more details, watch this session video. Also for being updated about our coming sessions follow us on Instagram, Facebook, Telegram or YouTube and be in touch with us here.

You can download this Session Slides form HERE

0.00 avg. rating (0% score) - 0 votes


0 0 votes
Article Rating

Inline Feedbacks
View all comments