Part - 2 ASP - NET Core Project File
Part - 2 ASP - NET Core Project File
Let us understand what changes are made to the ASP.NET Core Project file with an example. So, let’s
create a new ASP.NET Core Empty Project.
Once you click on the Create a new project box, it will open the “Create a new project” window. This
window includes different .NET 6 application templates. Here we will create a simple Web application
from scratch, so select the ASP.NET Core Empty Project template and then click on the Next button
as shown in the below image.
Once you click on the Next button, it will open the following Configure Your New Project window.
Here, you need to provide the necessary information to create a new project. First, give an appropriate
name for your project (FirstCoreWebApplication), set the location where you want to create this
Once you click on the Next button, it will open the Additional Information window. Here, you need to
select .NET 6.0 as the Framework, you also need to check the Configure for HTTPS and Do not use
top-level statements check boxes and finally click on the Create button as shown in the below image.
Once you click on the Create button, it will create a new ASP.NET Core Web Application in Visual Studio
2022 using .NET 6 with the following file and folder structure.
Once you click on the “Edit Project File” then the Project file will open in the Visual Studio editor as
shown in the below image.
Whenever we add any new packages to our application, then that package reference is also going to
be added to the application project file. Please have a look at the following Dependencies section of
your project. Whenever we add any packages, then that package and its dependency packages are
going to be stored here.
Let us first add a package from the NuGet Package Manager and see what happens. Go to tools =>
NuGet Package Manager => Manage NuGet Packages for Solution… option from the context menu
as shown in the below image.
Once the package is installed successfully, then you will see, it will add the reference inside the
dependencies section as shown in the below image.
As we have only added one package i.e. Newtonsoft.json, it added that package references here. Along
with the same, it will also add that package reference in the application project file as shown in the
below image.
Note: Once you delete that package, then it will delete the reference from both the dependencies as
well as from the project file.
Once you delete the package, then it should remove the reference from both the dependencies as well
as from the project file. The Package Reference element of the project file is used to add the references
to all the NuGet Packages which are installed for your application.
Note: The CSPRJ file includes settings related to targeted .NET Core Framework, Nullable,
ImplicitUsings, NuGet Package References, etc…