Ignore ReflectionTypeLoadException

This commit is contained in:
VladV 2022-05-08 14:40:11 +03:00
parent 0841d5e9dd
commit e6138b340b

View File

@ -34,7 +34,17 @@ namespace TriInspector.Utilities
if (_allNonAbstractTypesBackingField == null)
{
_allNonAbstractTypesBackingField = Assemblies
.SelectMany(asm => asm.GetTypes())
.SelectMany(asm =>
{
try
{
return asm.GetTypes();
}
catch (ReflectionTypeLoadException)
{
return Array.Empty<Type>();
}
})
.Where(type => !type.IsAbstract)
.ToList();
}