Skip to content

Instantly share code, notes, and snippets.

@anaisbetts
Created July 6, 2012 00:15
Show Gist options
  • Select an option

  • Save anaisbetts/3057262 to your computer and use it in GitHub Desktop.

Select an option

Save anaisbetts/3057262 to your computer and use it in GitHub Desktop.
internal static Type reallyFindType(string type, bool throwOnFailure)
{
#if WINRT
// WinRT hates your favorite band too.
return Type.GetType(type, false);
#else
return AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(x => x.GetTypes())
.Where(x => x.FullName == type)
.FirstOrDefault();
#endif
}
@nuclearsandwich
Copy link
Copy Markdown

explain?

@anaisbetts
Copy link
Copy Markdown
Author

@nuclearsandwich This is trying to find a Type in all the loaded assemblies. Unfortunately, there is no way in WinRT to get the loaded assembly list, or to do a type search that isn't limited to the executing assembly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment