2 using System.Reflection;
3 //using System.Runtime.CompilerServices;
10 static bool IsSigned ()
12 return (Assembly.GetExecutingAssembly ().GetName ().GetPublicKey () != null);
18 // aptclib.dll is strongnamed and DOESN'T have [AllowPartiallyTrustedCallers]
19 // so this call will work ONLY IF this assembly IS strongnamed
20 string s = AptcLibrary.Hello ("World");
21 int ec = IsSigned () ? 0 : 1;
22 Console.WriteLine ("*{0}* AptcLibrary: {1}", ec, s);
25 catch (SecurityException se) {
26 int ec = IsSigned () ? 1 : 0;
27 Console.WriteLine ("*{0}* Expected SecurityException\n{1}", ec, se);
31 Console.WriteLine ("*2* Unexpected exception\n{0}", e);