As you might already be aware Asp.net core is a platform made of nuget packages. There are different packages targeting different version of frameworks available say .net 4.6, Asp.net core 1.0,1.1 and 2.0. We generally classify frameworks into 2 categories:
- Traditional framework e.g. .net 4.6 which includes .Net framework where most of things are predefined and need not be configured
- Package-based frameworks which are created entirely from scratch by choosing packages as and when required
Package based frameworks are not easy to use and required a different/higher level of understanding of all required packages and most of the .net developers are used to work with predefined templates provided by visual studio.
This problem has been work around by introducing the concept of metapackages which are a collection of commonly used packages required by apps.
In older versions of .net core tools (both project.json and csproj-based tools) by default specified both a framework and a metapackage but in later versions metapackages were tied to specific frameworks . Depending on targeted framework appropriate metapackage is already added to project. This feature is also called as implicit referencing of metapackages. For example
netcoreapp1.1 framework references the Microsoft.NETCore.App Version 1.1.0 metapackage
By targeting a framework and implicitly adding a metapackage all the dependent packages are automatically referenced in project and their intellisense is also made available .
Some common metapackages which were part of older versions are :
Contains libraries which are part of .net standard work i.e .Net core, .Net framework and mono
Contains libraries which are part of .net core only
Contains a set of compatibility facades that enable mscorlib-based Portable Class Libraries (PCLs) to run on .NET Core.
Asp.net core 2.0 has introduced a new metapackage names Microsoft.AspNetCore.All which reduce the task of setting up your project by including everything that’s needed.
The metapackage includes:
- All Asp.net core supported packages
- All Entity Framework Core supported packages
- Any third-party dependency used by above frameworks to run
You can improve performance as well as have smooth deployment if you are using Asp.net core metapackage since any application that is using Microsoft.AspNetCore.All will automatically take advantage of .net core runtime store. This has some advantages:
- You don’t need to deploy the package separately as its already built inside core runtime and thus reducing the size of deployment package
- Since Runtime Store precompiles all assets it considerable improves load time
The version of Microsoft.AspNetCore.All package will be dependent on Asp.net core version its targeting and the latest version is 2.0.0.