Skip to content

Instantly share code, notes, and snippets.

@gamemachine
Created March 4, 2019 22:01
Show Gist options
  • Select an option

  • Save gamemachine/673248176dbd82c7ca6ddbc25a51f716 to your computer and use it in GitHub Desktop.

Select an option

Save gamemachine/673248176dbd82c7ca6ddbc25a51f716 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace AwesomeTechnologies.Extensions
{
public static class VsProExtensions
{
public static IEnumerable<Type> GetLoadableTypes(this Assembly assembly)
{
if (assembly == null) throw new ArgumentNullException(nameof(assembly));
try
{
return assembly.GetTypes();
}
catch (ReflectionTypeLoadException e)
{
return e.Types.Where(t => t != null);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment