gpt4 book ai didi

.net - .NET Core 是否有 GAC 等价物?

转载 作者:行者123 更新时间:2023-12-03 11:23:58 29 4
gpt4 key购买 nike

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

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

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

最佳答案

编辑 2017-09-01

有点类似于 GAC,.NET Core 2.0 引入了“Runtime package store”:

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.

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).



您正在寻找“依赖于框架的部署”。来自 the docs :

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

  • 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.

  • 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 - .NET Core 是否有 GAC 等价物?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35538093/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com