C# Asp.net Core中的Metapackage是什么?

It is known that Microsoft.AspNetCore package is one of the packages added tomany ASP.NET Core templates.

The Microsoft.AspNetCore package is repeatedly included as one of the usual project在打开一个新的ASP.NET Core项目时,它提供了许多依赖项关键的软件包以设置一个基本的ASP.NET Core应用程序。

尽管如此,该软件包不包含任何实际的dll或代码,它仅包含a series of dependencies on additional packages. By adding this package to yourproject, you bring in all the relevant packages along with their dlls on which itdepends and it is called a metapackage.

specifically, the packages it lists are −

Microsoft.AspNetCore.DiagnosticsMicrosoft.AspNetCore.HostingMicrosoft.AspNetCore.RoutingMicrosoft.AspNetCore.Server.IISIntegrationMicrosoft.AspNetCore.Server.KestrelMicrosoft.Extensions.Configuration.EnvironmentVariablesMicrosoft.Extensions.Configuration.FileExtensionsMicrosoft.Extensions.Configuration.JsonMicrosoft.Extensions.LoggingMicrosoft.Extensions.Logging.ConsoleMicrosoft.Extensions.Options.ConfigurationExtensionsNETStandard.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 basicASP.NET Core服务器使用Kestrel Web服务器,并包含IIS集成。

就应用程序本身而言,仅使用此软件包,您可以加载将应用程序设置和环境变量转换为配置,请使用IOptionsinterface,并配置日志输出到控制台。

对于中间件,只包括 Microsoft.AspNetCore.Diagnostics 包这将允许添加中间件,如ExceptionHandlerMiddleware,the开发者异常页面中间件(DeveloperExceptionPageMiddleware)和状态码页面中间件(StatusCodePagesMiddleware)。

为了完成一个应用程序,我们不能仅仅使用元包(Metapackage),因为它不提供足够的控制,但我们可以使用 Microsoft.AspNetCore.Mvc 或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应用程序,这样我们就不需要加载更多的依赖项,但实际上并没有这样做that because it requires other packages as well. Thus, if the number of packages islarge then the dependencies increases which impacts the real use of metapackage. Forexample, one of the dependencies on which the Microsoft.AspNetCore depends is theNETStandard.Library package, which is also a metapackage and hence the依赖关系增加。

以上就是C# Asp.net Core中的Metapackage是什么?的详细内容,更多请关注【创想鸟】其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。

发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/2431690.html

(0)
上一篇 2025年3月3日 08:45:50
下一篇 2025年2月28日 21:53:54

AD推荐 黄金广告位招租... 更多推荐

相关推荐

发表回复

登录后才能评论