Assembly.GetTypes() throws a ReflectionTypeLoadException when there are types which cannot be loaded.
That exception has a Types[] property which lists the types which successfully loaded, and an LoaderExceptions[] property listing the exceptions for types which failed to load.
My question: How do I get the types themselves which correspond to the LoaderExceptions?
Edit: I'm actually looking for the name of the type which failed to load. Sorry for any confusion there.
This is just not possible. The CLR failed to create the Type objects which is why you got the set of LoaderExceptions. There is simply no Type object to describe a Type which failed to load.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With