Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created September 6, 2015 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelovstanton/627a2487c5bc57c62ec9 to your computer and use it in GitHub Desktop.
Save angelovstanton/627a2487c5bc57c62ec9 to your computer and use it in GitHub Desktop.
private static void ExecuteFromAssembly(Assembly assembly)
{
Type helloKittyPrinterType = assembly.GetType("HelloKittyPrinter");
MethodInfo printMethod = helloKittyPrinterType.GetMethod("Print");
object kitty = assembly.CreateInstance("HelloKittyPrinter");
printMethod.Invoke(kitty, BindingFlags.InvokeMethod, null, null, CultureInfo.CurrentCulture);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment