Guest User

Untitled

a guest
Feb 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace ServiceLocatorApplication
  6. {
  7. public static class AppDomainExtensions
  8. {
  9. public static IEnumerable<Type> GetTypes(this System.AppDomain domain)
  10. {
  11. return domain.GetAssemblies().SelectMany(s => {
  12. try {
  13. return s.GetTypes();
  14. } catch (System.Reflection.ReflectionTypeLoadException) {
  15. return new Type[0];
  16. }
  17. });
  18. }
  19. }
  20. }
Add Comment
Please, Sign In to add comment