Understanding the .NET Core 2.0 runtime package store

Posted: (EET/GMT+2)

 

With the release of .NET Core 2.0, Microsoft introduced a new concept called the runtime package store. It's designed to reduce deployment size and startup time for applications that share common framework libraries.

Normally, when you publish a .NET Core application as a self-contained deployment, all required assemblies are copied into your output folder. The runtime package store provides a way for multiple applications on the same machine to reuse shared framework assemblies that are already installed.

The store is located under the .NET installation path, for example:

C:\Program Files\dotnet\store\x64\netcoreapp2.0\

When you publish an app with the "--manifest" option, the publish process excludes packages that are already in the store:

dotnet publish --manifest store.manifest.json

This makes the final deployment smaller, since it references the shared assemblies instead of duplicating them. It's a good fit for servers running many .NET Core apps, such as web servers or microservices.