ContextUtil.IsSecurityEnabled Property


Gets a value that indicates whether role-based security is active in the current context.

Namespace:   System.EnterpriseServices
Assembly:  System.EnterpriseServices (in System.EnterpriseServices.dll)

public static bool IsSecurityEnabled { get; }

Property Value

Type: System.Boolean

true if the current context has security enabled; otherwise, false.

Exception Condition

There is no COM+ context available.

The following code example gets the value of a IsSecurityEnabled property.

public class ContextUtil_IsSecurityEnabled : ServicedComponent
    public void Example()
        // Display whether role-based security is active for the current COM+
        // context.
        Console.WriteLine("Role-based security active in current context: {0}",

.NET Framework
Available since 1.1
Return to top