[netcore] Ongoing work. (#13391)
[mono-project.git] / mono / tests / module-cctor-loader.2.cs
blob7751c29dccb6263b92a0cc856e2269eea65996a7
1 using System;
3 public class Program
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);
17 if (val == 1)
18 return 0;
19 return 1;