IsSecuritySafeCritical Property

MethodBase.IsSecuritySafeCritical Property

.NET Framework 4.6 and 4.5

Gets a value that indicates whether the current method or constructor is security-safe-critical at the current trust level; that is, whether it can perform critical operations and can be accessed by transparent code.

Namespace:   System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

Public Overridable ReadOnly Property IsSecuritySafeCritical As Boolean

Property Value

Type: System.Boolean

true if the method or constructor is security-safe-critical at the current trust level; false if it is security-critical or transparent.

The IsSecurityCritical, IsSecuritySafeCritical, and IsSecurityTransparent properties report the transparency level of the method or constructor at its current trust level, as determined by the common language runtime (CLR). The combinations of these properties are shown in the following table:

Security level








Safe critical








Using these properties is much simpler than examining the security annotations of an assembly and its types and members, checking the current trust level, and attempting to duplicate the runtime's rules.


For partial-trust assemblies, the value of this property depends on the current trust level of the assembly. If the assembly is loaded into a partially trusted application domain (for example, into a sandboxed application domain), the runtime ignores the security annotations of the assembly. The assembly and all its types are treated as transparent. The runtime pays attention to the security annotations of a partial-trust assembly only when that assembly is loaded into a fully trusted application domain (for example, into the default application domain of a desktop application). By contrast, a trusted assembly (that is, a strong-named assembly that is installed in the global assembly cache) is always loaded with full trust regardless of the trust level of the application domain, so its current trust level is always fully trusted. You can determine the current trust levels of assemblies and application domains by using the Assembly.IsFullyTrusted and AppDomain.IsFullyTrusted properties.

For more information about reflection and transparency, see Security Considerations for Reflection. For information about transparency, see Security Changes in the .NET Framework.

.NET Framework
Available since 4.0
Return to top
© 2015 Microsoft