public Caching(HashSet <Assembly> mefAssemblies, RuntimeCompositionExceptionHandler exceptionHandler, Func <string, string>?getCacheFilePath = null, ICachingFaultInjector?cachingFaultInjector = null)
            {
                getCacheFilePath = getCacheFilePath ?? (file => Path.Combine(AddinManager.CurrentAddin.PrivateDataPath, file));

                // TODO: .NET 4.7.2 has a capacity constructor - https://github.com/mono/monodevelop/issues/7198
                loadedAssemblies = new HashSet <Assembly> ();
                foreach (var asm in AppDomain.CurrentDomain.GetAssemblies())
                {
                    if (asm.IsDynamic)
                    {
                        continue;
                    }

                    loadedAssemblies.Add(asm);
                }

                MefAssemblies             = mefAssemblies;
                MefCacheFile              = getCacheFilePath("mef-cache");
                MefCacheControlFile       = getCacheFilePath("mef-cache-control");
                this.cachingFaultInjector = cachingFaultInjector;
                this.exceptionHandler     = exceptionHandler ?? new RuntimeCompositionExceptionHandler();
            }