Skip to content

Instantly share code, notes, and snippets.

@jonihietala
Last active May 27, 2018 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonihietala/bc02d0dc2343d5bf3aed405ab7cf2296 to your computer and use it in GitHub Desktop.
Save jonihietala/bc02d0dc2343d5bf3aed405ab7cf2296 to your computer and use it in GitHub Desktop.
// https://stackoverflow.com/questions/4667078/how-to-retrieve-the-loaderexception-property
try
{
foreach (var asm in AppDomain.CurrentDomain.GetAssemblies())
{
asm.GetTypes();
}
}
catch (Exception ex)
{
if (ex is System.Reflection.ReflectionTypeLoadException)
{
var typeLoadException = ex as ReflectionTypeLoadException;
var loaderExceptions = typeLoadException.LoaderExceptions; // Breakpoint
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment