2 using System.Reflection;
9 private const string icall = "internalGetGacPath";
11 static bool IsEcmaSigned ()
13 byte[] pk = Assembly.GetExecutingAssembly ().GetName ().GetPublicKey ();
14 if ((pk != null) && (pk.Length == 16) && (pk [8] == 0x04)) {
16 for (int i=0; i < pk.Length; i++)
26 MethodInfo mi = typeof (System.Environment).GetMethod (icall,
27 BindingFlags.Static | BindingFlags.NonPublic);
29 Console.WriteLine ("*3* Couldn't reflect on internalcall {0}", icall);
34 string gac = (string)mi.Invoke (null, null);
35 int ec = IsEcmaSigned () ? 0 : 1;
36 Console.WriteLine ("*{0}* internalGetGacPath: {1}", ec, gac);
39 catch (SecurityException se) {
40 int ec = IsEcmaSigned () ? 1 : 0;
41 Console.WriteLine ("*{0}* Expected SecurityException\n{1}", ec, se);
45 Console.WriteLine ("*2* Unexpected exception\n{0}", e);