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

WBOY
发布: 2023-08-22 10:25:13
转载
1002人浏览过

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 在打开一个新的ASP.NET Core项目时,它提供了许多依赖项 关键的软件包以设置一个基本的ASP.NET Core应用程序。

尽管如此,该软件包不包含任何实际的dll或代码,它仅包含 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服务器使用Kestrel Web服务器,并包含IIS集成。

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

对于中间件,只包括 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 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 依赖关系增加。

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

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:tutorialspoint网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号