5 public static int Main()
7 System
.Reflection
.Assembly asm
= System
.Reflection
.Assembly
.LoadFrom("module-cctor.exe");
8 Console
.WriteLine("assembly loaded");
9 Type type
= asm
.GetType("NS.TestClass", true);
10 Console
.WriteLine("got type 'NS.TestClass'");
12 System
.Reflection
.FieldInfo field
= type
.GetField("TestField");
13 Console
.WriteLine("about to get value of 'TestField'");
14 Console
.WriteLine("got field 'TestField'");
15 int val
= (int)field
.GetValue(null);
16 Console
.WriteLine("Value of field: " + val
);