diff --git a/src/Spectre.Console.Cli/Internal/Composition/ComponentRegistry.cs b/src/Spectre.Console.Cli/Internal/Composition/ComponentRegistry.cs index 278617a..1408845 100644 --- a/src/Spectre.Console.Cli/Internal/Composition/ComponentRegistry.cs +++ b/src/Spectre.Console.Cli/Internal/Composition/ComponentRegistry.cs @@ -35,11 +35,12 @@ internal sealed class ComponentRegistry : IDisposable foreach (var type in new HashSet(registration.RegistrationTypes)) { if (!_registrations.ContainsKey(type)) - { + { // Only add each registration type once. - _registrations.Add(type, new HashSet()); - _registrations[type].Add(registration); + _registrations.Add(type, new HashSet()); } + + _registrations[type].Add(registration); } }