[xbuild] ImportCollections.TryGetImport and other fixes
[mono.git] / mono / tests / cas / linkdemand / cas2.cs
1 using System;
2 using System.Security;
3 using System.Security.Permissions;
4
5 [assembly: SecurityPermission (SecurityAction.RequestRefuse, ControlPrincipal=true)]
6
7 public class Program {
8
9         [SecurityPermission (SecurityAction.LinkDemand, ControlPrincipal=true)]
10         public static int Test ()
11         {
12                 return 0;
13         }
14
15         static int Main ()
16         {
17                 // this isn't catchable as the exception occurs when compiling Main
18                 try {
19                         Test ();
20                         Console.WriteLine ("*0* Expected Unhandled SecurityException.");
21                         return 0;
22                 }
23                 catch (SecurityException) {
24                         Console.WriteLine ("*0* This SecurityException shouldn't be catched.");
25                         return 0;
26                 }
27         }
28 }