.NET Core 是否有任何 GAC 等价物? [英] Is there any GAC equivalent for .NET Core?

查看:29
本文介绍了.NET Core 是否有任何 GAC 等价物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如我目前在完整的 .NET Framework 中所了解的,当我们将框架安装到机器时,它会将整个 BCL 部署到计算机的 GAC.这样,当我们使用 .NET 开发软件并将其部署到该计算机时,它将使用 BCL 程序集,这些程序集在安装 .NET Framework 本身时已在 GAC 中提供.

As I currently understand in the full .NET Framework when we install the framework to the machine it deploys the whole BCL to the computer's GAC. In that way when we develop a software with .NET and deploy to that computer it'll use the BCL assemblies which are made available in the GAC when the .NET Framework itself was installed.

现在,据我所知,CoreFX 相当于新 .NET Core 的 BCL.然而,主要区别在于我们可以在 project.json 中指定我们需要哪些 CoreFX 部分.

Now, as I know CoreFX is the equivalent of the BCL for the new .NET Core. The main difference, however, is that we can specify in the project.json exactly which pieces of the CoreFX we need.

我的问题是:当我们部署 .NET Core 应用程序时,生产环境中是否有任何 GAC 等效项?那么,当我们部署要执行的应用程序时,计算机中是否有任何中心位置让应用程序查看整个 CoreFX 是否可用?

My question is: when we deploy .NET Core apps, is there any GAC equivalent on the production environment? So, when we deploy the app to be executed, is there any central location in the computer where the app will look to see if the whole CoreFX is available?

推荐答案

Edit 2017-09-01

有点类似于 GAC,.NET Core 2.0 引入了运行时包存储":

Somewhat analogous to the GAC, .NET Core 2.0 introduces the "Runtime package store":

从 .NET Core 2.0 开始,可以针对目标环境中存在的一组已知包打包和部署应用程序.在某些情况下,这样做的好处是部署速度更快、磁盘空间使用更少、启动性能更高.

Starting with .NET Core 2.0, it's possible to package and deploy apps against a known set of packages that exist in the target environment. The benefits are faster deployments, lower disk space use, and improved startup performance in some cases.

此功能作为运行时包存储实现,它是磁盘上存储包的目录(通常在 macOS/Linux 上的/usr/local/share/dotnet/store 和 C:/Program Files/dotnet/store在 Windows 上).

This feature is implemented as a runtime package store, which is a directory on disk where packages are stored (typically at /usr/local/share/dotnet/store on macOS/Linux and C:/Program Files/dotnet/store on Windows).

<小时>

您正在寻找依赖于框架的部署".来自文档:

您可以为 .NET Core 应用程序创建两种类型的部署:

You can create two types of deployments for .NET Core applications:

  • 依赖于框架的部署.顾名思义,依赖于框架的部署 (FDD) 依赖于存在于目标系统上的共享系统范围版本的 .NET Core.由于 .NET Core 已经存在,您的应用程序也可以在 .NET Core 的安装之间移植.你的应用只包含它自己的代码和 .NET Core 库之外的任何第三方依赖项.FDD 包含 .dll 文件,可以从命令行使用 dotnet 实用程序启动这些文件.例如,dotnet app.dll 运行名为 app 的应用程序.

  • Framework-dependent deployment. As the name implies, framework-dependent deployment (FDD) relies on a shared system-wide version of .NET Core to be present on the target system. Because .NET Core is already present, your app is also portable between installations of .NET Core. Your app contains only its own code and any third-party dependencies that are outside of the .NET Core libraries. FDDs contain .dll files that can be launched by using the dotnet utility from the command line. For example, dotnet app.dll runs an application named app.

独立部署.与 FDD 不同,独立部署 (SCD) 不依赖于目标系统上存在的任何共享组件.所有组件(包括 .NET Core 库和 .NET Core 运行时)都包含在应用程序中,并与其他 .NET Core 应用程序隔离.SCD 包括一个可执行文件(例如 Windows 平台上名为 app 的应用程序的 app.exe),它是特定于平台的 .NET Core 主机的重命名版本,以及.dll 文件(例如 app.dll),这是实际的应用程序.

Self-contained deployment. Unlike FDD, a self-contained deployment (SCD) does not rely on any shared components to be present on the target system. All components, including both .NET Core libraries and the .NET Core runtime, are included with the application and are isolated from other .NET Core applications. SCDs include an executable (such as app.exe on Windows platforms for an application named app), which is a renamed version of the platform-specific .NET Core host, and a .dll file (such as app.dll), which is the actual application.

这篇关于.NET Core 是否有任何 GAC 等价物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆