ASP.NET Core Project File

ASP.NET Core Project File

·         The project file does not contain any folder or file reference.

o    The File System determines what files and folders belong to the project. All files and folders that are present in the project root folder are part of the project and will be displayed in the solution explorer.

·         In asp.net core, we can edit the project file without unloading the project.

 

Exploring .csproj file in the editor. 

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>

    <TargetFramework>netcoreapp2.2</TargetFramework>

    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>

  </PropertyGroup>

  <ItemGroup>

    <PackageReference Include="Microsoft.AspNetCore.App" />

    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />

  </ItemGroup>

</Project>

o    TargetFramework :

§   TargetFramework is used to specify the target framework for your application i.e the set of APIs that you'd like to make available to the application.

§  To specify a target framework we use something called Target Framework Moniker (TFM). netcoreapp2.2 is the Moniker for .NET Core 2.2.

o    AspNetCoreHostingModel :

§  This specifies how the asp.net core application is hosted, InProcess or OutOfProcess.

§  InProcess :-  Host asp.net core app inside of the IIS worker process (w3wp.exe).

§  OutOfProcess:- Specifies that we want to use  out-of-process hosting model i.e forward web requests to a back-end ASP.NET Core app running the Kestrel server.

o    PackageReference :

§  To include a reference to all the NuGet packages those are installed for application.

§  Notice there is no version numbera on the metapackage. When the version is not specified, an implicit version is specified by the SDK. The .NET Core team recommends relying on the implicit version specified by the SDK and not explicitly setting the version number on the package reference.



Comments