-
-
Save takeshik/2789278 to your computer and use it in GitHub Desktop.
This file contains 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.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