.NET Core是否有等效的GAC? [英] Is there any GAC equivalent for .NET Core?

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

问题描述

正如我目前在完整的.NET Framework中所了解的那样,当我们将框架安装到计算机上时,它将整个BCL部署到计算机的GAC中。这样,当我们使用.NET开发软件并将其部署到该计算机时,它将使用BCL程序集,该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?

推荐答案

编辑2017-09-01

与GAC类似,.NET Core 2.0引入了 < a href = https://docs.microsoft.com/zh-cn/dotnet/core/deploying/runtime-store rel = noreferrer>运行时程序包存储:

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和Windows上的C:/ Program Files / dotnet / store)。

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天全站免登陆