Stashbox by Peter Csajtai

<PackageReference Include="Stashbox" Version="5.13.0-preview-825" />

 AssemblyExtensions

static class AssemblyExtensions
using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; namespace System.Reflection { internal static class AssemblyExtensions { [System.Runtime.CompilerServices.NullableContext(1)] public static IEnumerable<Type> CollectTypes(this Assembly assembly) { return assembly.ExportedTypes.Concat(from typeInfo in assembly.DefinedTypes select typeInfo.AsType()).Distinct(); } } }