SecurityManager.IsGranted is obsolete, replacement methods do not work in medium trust! RRS feed

  • Question

  • Hi,

    I know that SecurityManager.IsGranted should be replaced by with something like:
                var permissionSet = new PermissionSet(PermissionState.None);
                return permissionSet.IsSubsetOf(AppDomain.CurrentDomain.PermissionSet);
    But by running this code in Medium Trust you get: [SecurityException: Request failed.]

    Accessing AppDomain.CurrentDomain.PermissionSet in the method is enough to trigger the exception.

    Any suggestions?
    Tuesday, February 2, 2010 5:07 PM