Using the Microsoft.AspNetCore.App metapackage

When looking in Solution Explorer in the Dependencies | SDK section, you can see something very interesting, specific to ASP.NET Core 3 projects: the Microsoft.AspNetCore.App metapackage:

The Microsoft.AspNetCore.App project dependency was added automatically when you created your ASP.NET Core 3 web application. This is done by default for this type of project.

However, Microsoft.AspNetCore.App is not a standard NuGet package, since it does not contain any code or DLLs. Instead, it acts as a metapackage, referencing other packages that it depends on. To be more specific, it includes most of the important packages for ASP.NET Core and Entity Framework Core, together with their internal and external dependencies, and takes advantage of the .NET Core runtime store.

The main difference between the new Microsoft.AspNetCore.App metapackage, which targets the .NET Core 3 SDK or later, and the older Microsoft.AspNetCore.All metapackage, which targeted previous versions of .NET Core, is the fact that the App metapackage no longer includes third-party dependencies, which are not primarily supported by Microsoft. 

If your project is targeting Microsoft.NET.Sdk.Web then automatically you have access to the shared framework, and that includes packages for Application Insights, authentication, authorization, Azure App Services, and many others. In older versions of .NET Core (version 1.0 and 1.1), you had to add a horde of NuGet packages all by yourself.

Now that Microsoft has created the concept of the ASP.NET Core metapackage, you can find everything in one place. Furthermore, package trimming excludes binaries, which are not used, so that they are not published when deploying your applications.

Apart from what is already available to you with the shared framework, there are several classes that come already installed when you are using the ASP.NET Core 3 Framework, and we will take a look at them in the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.198.183