public void Dispose() { if (_wasDisposed) { return; } _wasDisposed = true; if (Role == ContainerRole.Root) { _singletons.DisposeAndClear(); } ContainerCache.DisposeAndClear(); _transients.DisposeAndClear(); _pluginGraph.SafeDispose(); if (Role == ContainerRole.Root) { _profiles.AllProfiles().Each(x => x.Dispose()); } _trackedDisposables.Each(x => x.Dispose()); }