Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
232 views
in Technique[技术] by (71.8m points)

Is there any GAC equivalent for .NET Core?

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.

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.

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Edit 2017-09-01

Somewhat analogous to the GAC, .NET Core 2.0 introduces the "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).


You are looking for a "Framework-dependent deployment". From 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...