Type.IsSecurityTransparent Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value that indicates whether the current type is transparent at the current trust level, and therefore cannot perform critical operations.
public:
virtual property bool IsSecurityTransparent { bool get(); };
public virtual bool IsSecurityTransparent { get; }
member this.IsSecurityTransparent : bool
Public Overridable ReadOnly Property IsSecurityTransparent As Boolean
true
if the type is security-transparent at the current trust level; otherwise, false
.
If this property returns true
, the IsSecurityCritical and IsSecuritySafeCritical properties return false
.
The IsSecurityCritical, IsSecuritySafeCritical, and IsSecurityTransparent properties report the transparency level of the type at its current trust level, as determined by the common language runtime (CLR). Using these properties is much simpler than examining the security annotations of an assembly and its types, checking the current trust level, and attempting to duplicate the runtime's rules.
Important
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), then 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.
Produit | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Commentaires sur .NET
.NET est un projet open source. Sélectionnez un lien pour fournir des commentaires :