

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is Metapackage in C# Asp.net Core?
It is known that Microsoft.AspNetCore package is one of the packages added to many ASP.NET Core templates.
The Microsoft.AspNetCore package is repeatedly included as one of the usual project dependencies when opening a new ASP.NET Core project. It delivers many of the crucial packages to position up a basic ASP.NET Core application.
Though, this package does not contain any actual dlls or code itself, it merely contains a series of dependencies on additional packages. By adding this package to your project, you bring in all the relevant packages along with their dlls on which it depends and it is called a metapackage.
Specifically, the packages it lists are −
Microsoft.AspNetCore.Diagnostics Microsoft.AspNetCore.Hosting Microsoft.AspNetCore.Routing Microsoft.AspNetCore.Server.IISIntegration Microsoft.AspNetCore.Server.Kestrel Microsoft.Extensions.Configuration.EnvironmentVariables Microsoft.Extensions.Configuration.FileExtensions Microsoft.Extensions.Configuration.Json Microsoft.Extensions.Logging Microsoft.Extensions.Logging.Console Microsoft.Extensions.Options.ConfigurationExtensions NETStandard.Library
The versions of these packages you will receive depends on which version of the Microsoft.AspNetCore package you install.
These dependencies deliver the primary basic libraries for setting up a basic ASP.NET Core server that uses the Kestrel web server and includes IIS Integration.
In terms of the application itself, with the help of this package alone you can load application settings and environment variables into configuration, use the IOptions interface, and configure logging to the console.
For middleware, only the Microsoft.AspNetCore.Diagnostics package is included, which would allow adding middleware such as the ExceptionHandlerMiddleware, the DeveloperExceptionPageMiddleware and the StatusCodePagesMiddleware.
To complete an application, we cannot use only Metapackage because it does not provide sufficient controls but we can use Microsoft.AspNetCore.Mvc or Microsoft.AspNetCore.MvcCore package to add MVC capabilities to our application, and also some other packages would be needed.
The metapackage just try to use a number of packages that can be applied to many applications so that we don’t need to load more dependencies but it actual does not do that because it requires other packages as well. Thus, if the number of packages is large then the dependencies increases which impacts the real use of metapackage. For example, one of the dependencies on which the Microsoft.AspNetCore depends is the NETStandard.Library package, which is also a metapackage and hence the dependencies increases.
- Related Questions & Answers
- What is ViewData in ASP .Net MVC C#?
- What is the significance of NonActionAttribute in ASP .Net MVC C#?
- What is the use of ChildActionOnly attribute in ASP .Net MVC C#?
- How to determine if C# .NET Core is installed?
- How to use ViewBag in ASP .Net MVC C#?
- What are the three segments of the default route, that is present in ASP .Net MVC\nC#?
- What are the levels at which filters can be applied in ASP .Net MVC C#?
- What is core JavaScript language?
- What is net investment hedge?
- What is Kestral C# Asp.net Core?
- What is serialization in C#.NET?
- What is routing in C# ASP.NET Core?
- What is Net Working Capital Ratio?
- How can we provide an alias name for an action method in Asp .Net MVC C#?
- What is Net Working Capital (NWC) Flow?