Welcome to the series of asp.net core tutorials, in this part we will discuss another new feature that has shipped with asp.net core 2.0
Let’s first discuss 2 problems faced by monolithic applications:
- All packages need to be deployed for application to run correctly and for different target environments there were challenges in picking the right version of package.
- Since packages are not precompiled the application load time becomes slow
To overcome these issues Asp.net core 2.0 has introduced the concept of runtime store using which you can package and deploy applications against a known set of packages that already exist in target environments.
Runtime package store is nothing but a directory on disk where packages are usually stored. This path is defined at “%ProgramFiles%/dotnet/store” on Windows and at “/usr/local/share/dotnet/store” on Mac machines
Note: if you don’t find this directory on your machine. You need to download asp.net core 2 from here
Runtime stores can be built by runtime/server administrator to optimize applications in a way that account for faster deployments and less disk space apart from having a very less load time.
To prepare runtime environments adminstrators create 2 files
- package store manifest (csproj)
<Project Sdk="Microsoft.NET.Sdk"> <ItemGroup> <PackageReference Include="<NUGET_PACKAGE>" Version="<VERSION>" /> </ItemGroup> </Project>
style="display:block; text-align:center;"
data-ad-format="fluid"
data-ad-layout="in-article"
data-ad-client="ca-pub-5021110436373536"
data-ad-slot="9215486331">
- target manifest
Shared with developers who can customize this file to lists the packages in the runtime package store
Once package store manifest file is setup you can run below command to provision the runtime
dotnet store --manifest <PATH_TO_MANIFEST_FILE
> --runtime <RUNTIME_IDENTIFIER> --framework <FRAMEWORK>
e.g.
dotnet store --manifest packages.csproj --runtime
win10-x64 --framework netstandard2.0 --framework-version 2.0.0
You can read more about dotnet store here https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-store
In next article we will discuss the types of deployment strategies and how we can take advantage of Runtime Store while deploying applications.
I am a corporate trainer and solution architect and have a great team of software professionals. Please contact in case you need our services by sending email to contact@techprocompsoft.com. Here is our company website .