2 using System.Reflection;
7 static bool RunningOnMono ()
9 bool mono = (Type.GetType ("Mono.Math.BigInteger") != null);
10 Console.WriteLine ("Running on {0} runtime...", mono ? "Mono" : "Microsoft");
18 bool mono = RunningOnMono ();
21 icall = "internalGetGacPath";
22 mi = typeof (System.Environment).GetMethod (icall, BindingFlags.Static | BindingFlags.NonPublic);
24 // private internal call for MS runtime
25 // http://msdn.microsoft.com/msdnmag/issues/04/11/NETMatters/
26 icall = "CompleteGuid";
27 mi = typeof (System.Guid).GetMethod (icall, BindingFlags.Instance | BindingFlags.NonPublic);
31 Console.WriteLine ("*3* Couldn't reflect on internalcall {0}", icall);
38 result = (string) mi.Invoke (null, null);
40 System.Guid g = new System.Guid ();
45 result = ((bool) mi.Invoke (g, null)).ToString ();
48 Console.WriteLine ("*0* [Reflected]{0}: {1}", icall, result);
51 catch (SecurityException se) {
52 Console.WriteLine ("*1* SecurityException\n{0}", se);
56 Console.WriteLine ("*2* Unexpected exception\n{0}", e);