Skip to content

Instantly share code, notes, and snippets.

@takeshik
Created May 25, 2012 17:15
Show Gist options
  • Save takeshik/2789278 to your computer and use it in GitHub Desktop.
Save takeshik/2789278 to your computer and use it in GitHub Desktop.
using System;
using System.Linq;
using System.Reflection;
internal static class Program
{
private static void Main()
{
var asm = Assembly.Load("ClassLibrary1");
var type = asm.GetType("Class");
var obj = Activator.CreateInstance(type);
var method = type.GetMethod("Func", BindingFlags.NonPublic | BindingFlags.Instance);
method.Invoke(obj, null);
}
}
/*
using System;
class Class
{
void Func()
{
Console.WriteLine("Test");
}
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment