This documentation is archived and is not being maintained.

ReflectionPermission.Flags Property

Gets or sets the type of reflection allowed for the current permission.

Namespace: System.Security.Permissions
Assembly: mscorlib (in mscorlib.dll)

public ReflectionPermissionFlag Flags { get; set; }
/** @property */
public ReflectionPermissionFlag get_Flags ()

/** @property */
public void set_Flags (ReflectionPermissionFlag value)

public function get Flags () : ReflectionPermissionFlag

public function set Flags (value : ReflectionPermissionFlag)

Not applicable.

Property Value

The set flags for the current permission.

Exception typeCondition


An attempt is made to set this property to an invalid value. See ReflectionPermissionFlag for the valid values.

The following code example shows the use of the Flags property. This example is part of a larger example provided for the ReflectionPermission class.

private static void IsSubsetOfDemo()
    ReflectionPermission reflectionPerm1 = new ReflectionPermission(ReflectionPermissionFlag.AllFlags);
    ReflectionPermission reflectionPerm2 = new ReflectionPermission(ReflectionPermissionFlag.ReflectionEmit);

    if (reflectionPerm2.IsSubsetOf(reflectionPerm1))
        Console.WriteLine(reflectionPerm2.Flags + " is a subset of " +
        Console.WriteLine(reflectionPerm2.Flags + " is not a subset of " +

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0