Skip to content

Instantly share code, notes, and snippets.

@fresky
Created July 24, 2012 08:54
Show Gist options
  • Save fresky/3168933 to your computer and use it in GitHub Desktop.
Save fresky/3168933 to your computer and use it in GitHub Desktop.
Get Assembly Types
public static IEnumerable<Type> GetAssemblyTypes(string filePath)
{
Assembly assembly =
Assembly.LoadFile(filePath);
IEnumerable<Type> types;
try
{
types = assembly.GetTypes();
}
catch (ReflectionTypeLoadException e)
{
types = e.Types.Where(t => t != null);
}
return types;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment