Is it advisable to add assemblies from nuget like Microsoft.Bcl.Async to the GAC and ngen them?

StackOverflow https://stackoverflow.com/questions/21373006

  •  03-10-2022
  •  | 
  •  

Question

Startup performance may be improved by having most assemblies ngen-ed and in the GAC, but for whatever reason I haven't come across recommendations to do this?

Was it helpful?

Solution

We've started to ship more and more framework components in an out-of-band fashion so that you don't have to build a setup or even have to wait for the next version of the .NET Framework.

That being said, assemblies coming from NuGet are like your application assemblies. Meaning, using NGEN and adding them to the GAC can improve your startup performance. As always, you should measure to see whether it makes a difference. GACing as well as NGENing add complexity to your deployment that should be offset by added value.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top