Created
March 4, 2019 22:01
-
-
Save gamemachine/673248176dbd82c7ca6ddbc25a51f716 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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